React-native-webrtc: Error: 'document is not defined' from JSONPPolling.prototype.doPoll - socket.io.js:1085

Created on 15 Mar 2016  路  4Comments  路  Source: react-native-webrtc/react-native-webrtc

Hi,
I wanted to add webrtc to my project. I successfully started demo app, it was great.
Now when I try to copy implementation from demo I get error:

screen shot 2016-03-15 at 18 28 13

Any clue will be helpful

Most helpful comment

This article might help https://medium.com/@ekryski/how-to-actually-use-socket-io-in-react-native-39082d8d6172#.xlyiaqjvf
also try setting jsonp false like this:
var socket = io.connect('http://react-native-webrtc.herokuapp.com', {jsonp: false})

All 4 comments

it happens both on ios and android

This article might help https://medium.com/@ekryski/how-to-actually-use-socket-io-in-react-native-39082d8d6172#.xlyiaqjvf
also try setting jsonp false like this:
var socket = io.connect('http://react-native-webrtc.herokuapp.com', {jsonp: false})

@parthi82 You are right.

Thank you.
The problem was with user agent (it must be set to 'react native'). When I was debugging in chrome, user agent was set automatically to chrome user agent. When I disabled debugging it started working.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ashishvista picture ashishvista  路  7Comments

tiensonqin picture tiensonqin  路  5Comments

idibidiart picture idibidiart  路  3Comments

abdymm picture abdymm  路  6Comments

benoitc picture benoitc  路  5Comments