简体   繁体   中英

How to launch a watchOS app from a notification?

I've started to learn watchKit and watchOS .

After finding out how to handle notifications coming from a button set inside PushNotificationPayload.apns , I would like to set up my own notification that is going to fire at a given time, wake up the user with some kind of notification while the app is in the background, and possibly launch the app.

How can I do that?

In watchOS 2, this required scheduling the notification on the phone. It wasn't possible to wake up the watch app from the phone.

In watchOS 3, you can now use the new UserNotifications framework to schedule, deliver, and handle local notifications right on the watch.

You can display an actionable notification on the watch, which can open your watch app from the notification.

WWDC 2016 covered this material in two Introduction to Notifications and Quick Interaction Techniques for watchOS sessions.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM