How to use the pusher-js/react-native.logToConsole function in pusher-js

To help you get started, we’ve selected a few pusher-js 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 rotembcohen / pokerBuddyApp / containers / GameView.js View on Github external
import styles, {app_red,app_pink} from '../Styles';
import * as utils from '../UtilFunctions';
import PlayerList from '../components/PlayerList';
import ResultList from '../components/ResultList';
import Button from '../components/Button';
import IconButton from '../components/IconButton';
import SafeImage from '../components/SafeImage';
import ListPicker from '../components/ListPicker';
import CalculatorInput from '../components/CalculatorInput';
import TutorialModal from '../components/TutorialModal';
import StatusBar from '../components/StatusBar';

import Pusher from 'pusher-js/react-native';

// Enable pusher logging - don't include this in production
Pusher.logToConsole = true;

var pusher = new Pusher(PUSHER_API_KEY, {
  cluster: PUSHER_CLUSTER,
  encrypted: true
});

export default class GameView extends Component {

	constructor(props){
		super(props);
		const {navigation} = props;
		const {user,game,token,showTutorial} = navigation.state.params;
		const is_host = (game.host === user.id);

		var channel = pusher.subscribe(game.identifier);
		channel.bind('game-update', function(data) {

pusher-js

Pusher Channels JavaScript library for browsers, React Native, NodeJS and web workers

MIT
Latest version published 1 year ago

Package Health Score

71 / 100
Full package analysis