We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
hello all, am using this to connect and subscribe
const pusher = await connect(); await pusher.subscribe({ channelName, onEvent: (event: PusherEvent) => { debugLog('Pusher-Event', event); Constants.PusherChannel.forEach(item => { if (event.channelName === item.channelName) { item.callback(event); } }); }, onSubscriptionSucceeded: (data: any) => { debugLog('Pusher-Subscription-Succeeded', { data, channelName, }); }, onSubscriptionError: (name: string, message: string) => { debugLog('Pusher-subscription-error', { channelName: name, status: 'error', message, }); }, }); const connect = async () => { const pusher = Pusher.getInstance(); if (pusher.connectionState !== 'CONNECTED') { await pusher.connect(); } return pusher; };
and i got a lot of crashes in android and ios on crashlytics
android :
Fatal Exception: java.lang.NullPointerException com.pusherwebsocketreactnative.PusherWebsocketReactNativeModule.connect (PusherWebsocketReactNativeModule.kt:7)
ios: Crashed: com.facebook.react.PusherWebsocketReactNativeQueue PusherWebsocketReactNative.swift - Line 196 @objc PusherWebsocketReactNative.connect(_:reject:) + 196
any idea what could be the issue
pusher-websocket-react-native: 1.3.1 react-native 0.75.3
The text was updated successfully, but these errors were encountered:
Hey, @AbdulkarimTaha I can't understand the execution context of your code example.
This example works for me
// other imports import { useMemo } from 'react'; import { Pusher, PusherChannel, PusherEvent, } from '@pusher/pusher-websocket-react-native'; const pusher = Pusher.getInstance(); export default function HomeScreen() { useMemo(async () => { try { await pusher.init({ apiKey: '...', cluster: '...', }); await pusher.connect(); await pusher.subscribe({ channelName: "my-channel", onSubscriptionSucceeded: (channel: PusherChannel) => { console.log(`SUBSCRIBED TO CHANNEL`); }, onEvent: (event: PusherEvent) => { console.log('Pusher-Event', event); }, }); } catch (e) { console.log(`ERROR: ${e}`); } }, []); return (<View></View>); }
Sorry, something went wrong.
evgeniibreikin
No branches or pull requests
hello all,
am using this to connect and subscribe
and i got a lot of crashes in android and ios on crashlytics
android :
Fatal Exception: java.lang.NullPointerException
com.pusherwebsocketreactnative.PusherWebsocketReactNativeModule.connect (PusherWebsocketReactNativeModule.kt:7)
ios:
Crashed: com.facebook.react.PusherWebsocketReactNativeQueue
PusherWebsocketReactNative.swift - Line 196
@objc PusherWebsocketReactNative.connect(_:reject:) + 196
any idea what could be the issue
pusher-websocket-react-native: 1.3.1
react-native 0.75.3
The text was updated successfully, but these errors were encountered: