File tree Expand file tree Collapse file tree
android/src/main/java/com/onesignal/flutter Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -227,6 +227,12 @@ public void onNotificationPermissionChange(boolean permission) {
227227 invokeMethodOnUiThread ("OneSignal#onNotificationPermissionDidChange" , hash );
228228 }
229229
230+ void onDetachedFromEngine () {
231+ // Unsubscribe so clicks while the engine is dead get queued by the native SDK
232+ // instead of dispatched on a detached channel.
233+ OneSignal .getNotifications ().removeClickListener (this );
234+ }
235+
230236 private void lifecycleInit (Result result ) {
231237 OneSignal .getNotifications ().removeForegroundLifecycleListener (this );
232238 OneSignal .getNotifications ().addForegroundLifecycleListener (this );
Original file line number Diff line number Diff line change @@ -48,7 +48,9 @@ public void onDetachedFromEngine(@NonNull FlutterPlugin.FlutterPluginBinding bin
4848 onDetachedFromEngine ();
4949 }
5050
51- private void onDetachedFromEngine () {}
51+ private void onDetachedFromEngine () {
52+ OneSignalNotifications .getSharedInstance ().onDetachedFromEngine ();
53+ }
5254
5355 @ Override
5456 public void onAttachedToActivity (@ NonNull ActivityPluginBinding binding ) {
You can’t perform that action at this time.
0 commit comments