| Title | Description |
|---|---|
Apple Watch Plugin |
Connect to Apple Watch via Watch Connectivity framework and send/receive messages. |
cordova plugin add https://github.com/thessler27/watch-plugin.gitYou must initialize the session for the Apple Watch listener to be activated and to send messages.
AppleWatch.initializeSession():Promise<boolean>Returns successful promise result with
trueboolean if successful connection, and throws an error with booleanfalseif unsuccessful.
document.addEventListener('cordovaAppleWatch:didReceiveMessage', handleWatchEventWithData)When the watch sends a message to the iOS device, it sends the data through this event.
AppleWatch.sendMessage(data):Promise<void>Send a message with a specific payload. You need to handle this message on the WatchOS device. The promise returns successful if the message was able to be sent. If it was not, it will return an error.
- iOS