-
Notifications
You must be signed in to change notification settings - Fork 54
New issue
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
PusherWebsocketReactNative.disconnect(_:reject:) () #124
Comments
Can you share more info about this, including the full stack trace and the code in use? |
Hi, I think I reproduced the same issue. It seems to occur when trying to disconnect an uninitialized Pusher instance. I encountered the following error:
I found a fix by performing the following check before disconnecting in the TypeScript code: if ( pusher != null && pusher.connectionState !== "DISCONNECTED" ) {
pusher.disconnect()
} Alternatively, another solution is to modify the PusherWebsocketReactNative.swift file as follows: public func disconnect(_ resolve:RCTPromiseResolveBlock,reject:RCTPromiseRejectBlock) {
PusherWebsocketReactNative.pusher.disconnect()
resolve(nil)
} to: public func disconnect(_ resolve:RCTPromiseResolveBlock,reject:RCTPromiseRejectBlock) {
if PusherWebsocketReactNative.pusher != nil {
PusherWebsocketReactNative.pusher.disconnect()
}
resolve(nil)
} |
@Gabfranck Thanks for sharing. Here's my PusherWebsocketReactNative.swift code: import PusherSwift @objc(PusherWebsocketReactNative)
} and here's our pusherDisconnect code in app.js file
|
@rahul-s-1110 i can see you have logged a new issue at #143 for your report. It isn't clear if your issue is directly related to the original issue so we should progress the invesitgation in #143 . |
Crash in iOS
The text was updated successfully, but these errors were encountered: