Skip to content

Crashed com.facebook.react.PusherWebsocketReactNativeQueue #171

@AbdulkarimTaha

Description

@AbdulkarimTaha

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

Metadata

Metadata

Labels

questionFurther information is requested

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions