问题
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