Created
June 12, 2017 18:57
-
-
Save johnmjackson/5437c9001e608113c33e9b609ac9c9cb to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Wait until the messenger is fully | |
// ready, then send a message | |
FxoMessenger.on('stateChanged', function(state) { | |
if (state === 'connected') { | |
FxoMessenger.sendMessage('Hey!'); | |
} | |
}); | |
// Subscribe to all messages received, | |
// logging them to the console | |
FxoMessenger.on('messageReceived', function(message) { | |
console.log(message); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment