How to use the react-native-watch-connectivity.subscribeToWatchReachability 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 jitsi / jitsi-meet / react / features / mobile / watchos / middleware.js View on Github external
function _appWillMount({ dispatch, getState }) {
    watch.subscribeToWatchReachability((error, reachable) => {
        dispatch(setWatchReachable(reachable));
        _updateApplicationContext(getState);
    });

    watch.subscribeToMessages((error, message) => {
        if (error) {
            logger.error('watch.subscribeToMessages error:', error);

            return;
        }

        const {
            command,
            sessionID
        } = message;
        const currentSessionID = _getSessionId(getState());