Can I switch from iOS app to Apple Watch?

I know that you can transfer from Watch to an iOS application, but I have a precedent where I want to do it the other way around.

The user will create a set of rules on the phone using a more active interface than is possible on the watch, and then transfer the service to the watch (intentionally, with something like a β€œsend watch” button) to monitor the results of their settings periodically on Watch for the next 30 minutes or so.

Is this possible, and if so, how do you do it?

+6
source share
1 answer

Using Handoff directly is not possible from iPhone to Apple Watch, because watchOS does not have any user interface or code to display call diverting applications from iPhone.

To have a similar effect, you can do one of the following:

1- You can simply tell the user to open the Watch app. If the user opens it, he can connect to the iOS application to receive handover data.

2- You can save data in Apple Watch on WatchConnectivity or in iCloud. Then, at any time when the user opens the Watch application, he can receive data from iCloud or WatchConnectivity , regardless of whether it will be in a minute or a week.

Note

You need to check if the application is installed, or if there is a paired Apple Watch:

Swift

 import WatchConnectivity if WCSession.isSupported(){ if WCSession.defaultSession().watchAppInstalled{ //... } } 

Objective-c

 #import <WatchConnectivity/WatchConnectivity.h> if ([WCSession isSupported]){ if ([WCSession defaultSession].watchAppInstalled){ //... } } 
0
source

Source: https://habr.com/ru/post/987532/


All Articles