Skip to content
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

Nullify _pusherInstance on disconnect #41

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,6 @@ class PusherService : MChannel {
val initArgs: JSONObject = args.getJSONObject("initArgs")
enableLogging = initArgs.getBoolean("enableLogging")

if(_pusherInstance == null) {
val options: JSONObject = args.getJSONObject("pusherOptions")
val pusherOptions = PusherOptions()

Expand Down Expand Up @@ -114,7 +113,6 @@ class PusherService : MChannel {
_pusherInstance = Pusher(args.getString("appKey"), pusherOptions)

debugLog("Pusher initialized")
}

result.success(null)
}
Expand Down Expand Up @@ -293,4 +291,4 @@ class PusherService : MChannel {
}
}

}
}
2 changes: 0 additions & 2 deletions ios/Classes/PusherService.swift
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@ class PusherService: MChannel {

Utils.enableLogging = pusherArgs.initArgs.enableLogging

if(_pusherInstance == nil) {
let pusherOptions = PusherClientOptions(
authMethod: pusherArgs.pusherOptions.auth == nil ? .noMethod : AuthMethod.authRequestBuilder(authRequestBuilder: AuthRequestBuilder(pusherAuth: pusherArgs.pusherOptions.auth!)),
host: pusherArgs.pusherOptions.cluster != nil ? .cluster(pusherArgs.pusherOptions.cluster!) : .host(pusherArgs.pusherOptions.host),
Expand All @@ -91,7 +90,6 @@ class PusherService: MChannel {
Utils.debugLog(msg: "Pusher initialized")

result(nil)
}
} catch let err {
Utils.errorLog(msg: err.localizedDescription)
result(FlutterError(code: "INIT_ERROR", message: err.localizedDescription, details: err))
Expand Down