Skip to content

Instantly share code, notes, and snippets.

@bgwaltney
Created October 31, 2018 22:26
Show Gist options
  • Select an option

  • Save bgwaltney/582c2042d85eaacc151e358c6027c22c to your computer and use it in GitHub Desktop.

Select an option

Save bgwaltney/582c2042d85eaacc151e358c6027c22c to your computer and use it in GitHub Desktop.
import Pusher from 'pusher-js/react-native';
// Enable pusher logging - don't include this in production
Pusher.logToConsole = true;
var pusher = new Pusher('d81f408fe7b6144f2c97', { cluster: 'us2', forceTLS: true });
var channel = pusher.subscribe('tweets'); //the channel you're subscribing to
channel.bind('new-tweets', function(data) { //listen for the new-tweet event
alert(JSON.stringify(data)); });
channel.bind('new-voice-actor', function(data) { // listen for the new-voice-actor event
alert(JSON.stringify(data)); });
/* When the backend part of this is done we will have each setting be an event type.
"Listen to polly immediately"
"Wait up to an hour for a voice actor"
"Wait two hours? etc." */
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment