Right, this is getting on my nerves now. iOS app installed on iPhone via Xcode. Watch app installed on Watch via Xcode. Both apps are running and are in the foreground.
iOS app launches on iPhone and reports:
- WCSession.isSupported = YES
- theDelegate.session.isPaired = YES
- theDelegate.session.watchAppInstalled = NO
- theDelegate.session.activationState = Activated
I press a button in the Watch app. It reports:
- session == activated and reachable
iOS app delegate receives a message from the Watch app:
didReceiveMessage (from Watch): message = {
action = giveMeUpdatedItems;
}
The apps must be installed on the devices in order for the Watch app to have used sendMessage
(which is only available if the session is reachable, which it is).
iOS app delegate passes that through as a notification to another bit of code that collates the info and sends it back to the Watch app.
watchNotificationUpdateData; userInfo = {
action = giveMeUpdatedItems;
}
That bit of code in the iOS app checks whether we can send data to the Watch app, and doesn't send the data because:
- WCSession.isSupported = YES
- theDelegate.session.isPaired = YES
- theDelegate.session.watchAppInstalled = NO
- theDelegate.session.activationState = Activated
If I remove the check for watchAppInstalled
, I get this:
Error sending Watch application context: Watch app is not installed.
{
NSLocalizedDescription = "Watch app is not installed.";
NSLocalizedRecoverySuggestion = "Install the Watch app.";
}
I've deleted and reinstalled the app on both devices countless times. I've rebooted the devices, plus the Mac. I've reinstalled Xcode. I've cleaned builds. I've deleted DerivedData. And still it says the companion app isn't installed.