Search code examples
iosnotificationsuilocalnotificationwatchkitapple-watch

Is it possible to send a local notification to the Apple Watch specifically?


I see this in the Apple Watch Programming Guide:

When one of your app’s local or remote notifications arrives on the user’s iPhone, iOS decides whether to display that notification on the iPhone or on the Apple Watch.

Is there a way to make a notification only appear on the watch?


Solution

  • Unfortunately no, with watch apps you now need to handle notifications in 3 places. When the app is running, application:didReceiveLocalNotification: is called. When the phone is unlocked the notification is sent to the notification center and you'll need to handle the user selecting it in application:didFinishLaunchingWithOptions:. The watch will automatically handle any notification its containing app gets, displaying the app and the alert's body. If you want a custom notification you'll need to setup a notification category in the containing app and a dynamic notification in the watch. If you're trying to just get information from the app to the watch you can use the app groups dictionary or the openParentApplication:reply: method.