Reputation: 7210
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?
Upvotes: 6
Views: 4971
Reputation:
This was not possible until watchOS 3.
watchOS 3 introduces the User Notifications framework, which supports the delivery and handling of local and remote notifications. You can use the classes of this framework to schedule the delivery of local notifications based on specific conditions, such as a date or time or after a time interval, and to receive and handle local and remote notifications when they are delivered to the user’s device.
You can now schedule a local notification on the watch, and the notification is (delivered to and) only handled by the watch. It will not appear on the phone.
For more information, see the WWDC 2016 Introduction to Notifications, and Quick Interaction Techniques for watchOS sessions.
Useful picture from this guide:
Upvotes: 11
Reputation: 4016
Whatever you can do on the watch app, you can check it from this relatively simple documentation:https://developer.apple.com/library/ios/documentation/General/Conceptual/WatchKitProgrammingGuide/
And I don't think you can do something like what you say. We have to admit that there are a lots limitations in this version of WatchKit.
Upvotes: 0
Reputation: 274
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.
Upvotes: 3