Skip to content

thessler27/watch-plugin

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

43 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Title Description
Apple Watch Plugin
Connect to Apple Watch via Watch Connectivity framework and send/receive messages.

Installation

cordova plugin add https://github.com/thessler27/watch-plugin.git

Utilization

You must initialize the session for the Apple Watch listener to be activated and to send messages.

Initialize

AppleWatch.initializeSession():Promise<boolean>

Returns successful promise result with true boolean if successful connection, and throws an error with boolean false if unsuccessful.

Watch for incoming messages

document.addEventListener('cordovaAppleWatch:didReceiveMessage', handleWatchEventWithData)

When the watch sends a message to the iOS device, it sends the data through this event.

Send a message to the watch listener

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.

Supported Platforms

  • iOS

About

Cordova Plugin for Apple Watch

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published