Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to simulate the Local Notification in apple Watch App?

I am trying to simulate the local notification view in apple watch simulator. Does any one known how to simulate the local notifications in apple watch ?

I have done some research for that but didn't found any answer for the above. There is a way to simulate the PUSH NOTIFICATION but not for the LOCAL NOTIFICATION.

like image 257
NSAnant Avatar asked Nov 28 '14 12:11

NSAnant


People also ask

How do you get custom notifications on Apple Watch?

Open the Apple Watch app on your iPhone. Tap My Watch, then tap Notifications. Tap the app (for example, Messages), tap Custom, then choose an option.

Can you get notifications on Apple Watch without phone?

A Wi-Fi or cellular connection lets your Apple Watch do the following things, even if your iPhone isn't with you. Use Siri to get directions, send iMessages, and more. Send and receive messages.


1 Answers

It is not possible to have a Watch app react to a UILocalNotification in the simulator. However, it is almost identical to reacting to a push notification, except it gets routed through a couple of different methods.

If you're presenting an actionable notification, your WKUserNotificationInterfaceController subclass would override -didReceiveLocalNotification:withCompletion: instead of -didReceiveRemoteNotification:withCompletion:.

If your Watch app is getting launched in response to interacting with one of your actionable notifications, then your root WKInterfaceController would implement -handleActionWithIdentifier:forLocalNotification: or -handleActionWithIdentifier:forRemoteNotification:, as appropriate.

From WatchKit's point-of-view, those are the only distinctions between remote and local notifications.

like image 189
Dave DeLong Avatar answered Oct 07 '22 02:10

Dave DeLong