@@ -43,9 +43,7 @@ public class OneSignalPlugin
43
43
OneSignal .OSNotificationWillShowInForegroundHandler {
44
44
45
45
/** Plugin registration. */
46
- private OSNotificationOpenedResult coldStartNotificationResult ;
47
46
private OSInAppMessageAction inAppMessageClickedResult ;
48
- private boolean hasSetNotificationOpenedHandler = false ;
49
47
private boolean hasSetInAppMessageClickedHandler = false ;
50
48
private boolean hasSetNotificationWillShowInForegroundHandler = false ;
51
49
private boolean hasSetRequiresPrivacyConsent = false ;
@@ -157,7 +155,6 @@ private void addObservers() {
157
155
OneSignal .addEmailSubscriptionObserver (this );
158
156
OneSignal .addPermissionObserver (this );
159
157
OneSignal .setNotificationWillShowInForegroundHandler (this );
160
- OneSignal .setNotificationOpenedHandler (this );
161
158
}
162
159
163
160
private void setLogLevel (MethodCall call , Result reply ) {
@@ -337,11 +334,7 @@ public void onFailure(OneSignal.ExternalIdError error) {
337
334
}
338
335
339
336
private void initNotificationOpenedHandlerParams () {
340
- this .hasSetNotificationOpenedHandler = true ;
341
- if (this .coldStartNotificationResult != null ) {
342
- this .notificationOpened (this .coldStartNotificationResult );
343
- this .coldStartNotificationResult = null ;
344
- }
337
+ OneSignal .setNotificationOpenedHandler (this );
345
338
}
346
339
347
340
private void initInAppMessageClickedHandlerParams () {
@@ -403,11 +396,6 @@ public void onOSPermissionChanged(OSPermissionStateChanges stateChanges) {
403
396
404
397
@ Override
405
398
public void notificationOpened (OSNotificationOpenedResult result ) {
406
- if (!this .hasSetNotificationOpenedHandler ) {
407
- this .coldStartNotificationResult = result ;
408
- return ;
409
- }
410
-
411
399
try {
412
400
invokeMethodOnUiThread ("OneSignal#handleOpenedNotification" , OneSignalSerializer .convertNotificationOpenResultToMap (result ));
413
401
} catch (JSONException e ) {
0 commit comments