How to use the react-native-watch-connectivity.subscribeToWatchState function in react-native-watch-connectivity

To help you get started, we’ve selected a few react-native-watch-connectivity examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github rdev / now-mobile / src / Provider.js View on Github external
});
		watch.subscribeToWatchReachability((err, watchIsReachable) => {
			if (!err) {
				this.setState({ watchIsReachable });

				if (watchIsReachable) {
					this.sendTokenToWatch();
				}
			}
		});
		watch.getWatchState((err, watchState) => {
			if (!err && watchState === 'Activated') {
				this.sendTokenToWatch();
			}
		});
		watch.subscribeToWatchState((err, watchState) => {
			if (!err && watchState === 'Activated') {
				this.sendTokenToWatch();
			}
		});
	};
github BlueWallet / BlueWallet / WatchConnectivity.ios.js View on Github external
Watch.getIsWatchAppInstalled((err, isAppInstalled) => {
      if (!err) {
        WatchConnectivity.shared.isAppInstalled = isAppInstalled;
        Watch.subscribeToWatchState((err, watchState) => {
          if (!err) {
            if (watchState === 'Activated') {
              WatchConnectivity.shared.sendWalletsToWatch();
            }
          }
        });
        Watch.subscribeToMessages(async (err, message, reply) => {
          if (!err) {
            if (message.request === 'createInvoice') {
              const createInvoiceRequest = await this.handleLightningInvoiceCreateRequest(
                message.walletIndex,
                message.amount,
                message.description,
              );
              reply({ invoicePaymentRequest: createInvoiceRequest });
            } else if (message.message === 'sendApplicationContext') {