Skip to content
Merged
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 @@ -227,6 +227,12 @@ public void onNotificationPermissionChange(boolean permission) {
invokeMethodOnUiThread("OneSignal#onNotificationPermissionDidChange", hash);
}

void onDetachedFromEngine() {
// Unsubscribe so clicks while the engine is dead get queued by the native SDK
// instead of dispatched on a detached channel.
OneSignal.getNotifications().removeClickListener(this);
}
Comment thread
nan-li marked this conversation as resolved.

private void lifecycleInit(Result result) {
OneSignal.getNotifications().removeForegroundLifecycleListener(this);
OneSignal.getNotifications().addForegroundLifecycleListener(this);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,9 @@ public void onDetachedFromEngine(@NonNull FlutterPlugin.FlutterPluginBinding bin
onDetachedFromEngine();
}

private void onDetachedFromEngine() {}
private void onDetachedFromEngine() {
OneSignalNotifications.getSharedInstance().onDetachedFromEngine();
}

@Override
public void onAttachedToActivity(@NonNull ActivityPluginBinding binding) {
Expand Down
Loading