问题
I have some events that should only be fired off if a user has an Apple Watch. Is there a way to detect whether a watch is paired? I'm not sure if I can use the shared app group to detect the Apple Watch extension or maybe I can use bluetooth?
回答1:
The best you an do is set a BOOL to true in shared NSUserDefaults the first time the Watch app is run and then check for that value in your iOS app. All indications on the dev forums and publicly have been that there isn't a way to programatically know if a Watch has been paired.
回答2:
This is possible on watchOS2.0+
I tried to give an answer here https://stackoverflow.com/a/44190804/2946782
you can check if connectivity session is supported as described here: How to check whether iPhone and apple watch are connected
来源:https://stackoverflow.com/questions/29681458/detecting-apple-watch-in-ios-8