How to show notification in iWatch?

99封情书 提交于 2019-12-12 05:30:05

问题


In my app, I want to implement functionality like when iPhone away with some distance from iWatch than watch app show local notification with a text message


回答1:


If it is enough for you to get notified when the Watch gets disconnected from the Phone, you could use the WatchConnectivity framework to achieve this. The optional func sessionReachabilityDidChange(_:) gets called on the Watch when it disconnects from the Phone. However, your WatchExtension needs to be running in the foreground or with high priority in the background for this function to work.



来源:https://stackoverflow.com/questions/44283630/how-to-show-notification-in-iwatch

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!