This repository was archived by the owner on Feb 7, 2024. It is now read-only.

Description
Hi guys,
I have developed a react app using laravel and react-js by laravel-websockets and it works well !
However, when I want to use it in a react native application, It throws an exception:
ExceptionsManager.js:180 TypeError: Cannot read property 'presenceChannel' of undefined
import Pusher from 'pusher-js/react-native'
import Echo from 'laravel-echo'
newEcho() {
Pusher.logToConsole = true;
let push = new Pusher('******',{
wsHost: 'push.******.com',
wssPort: 6001,
wsPort: 6001,
})
return new Echo({
broadcaster: push,
key: '********'
disableStats: true,
forceTLS: true,
authEndpoint: 'https://*******/broadcasting/auth',
auth: {
headers: {
Authorization: `Bearer ${API_TOKEN}`,
Accept: 'application/json',
},
},
});
}
componentDidMount() {
let EchoChannel = this.newEcho().join(`chat.${this.state.drtoken}`);
console.log(EchoChannel);
}