Created
July 5, 2017 12:19
-
-
Save johnmjackson/a56af353f58bfcb1603d9dbc73bc704b 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
<script src="https://widget.flowxo.com/embed.js" data-fxo-widget="my-own-widget-code"></script> | |
<script> | |
// 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); | |
}); | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment