|
38 | 38 | import androidx.annotation.NonNull; |
39 | 39 | import androidx.annotation.WorkerThread; |
40 | 40 | import com.leanplum.LeanplumActivityHelper.NoTrampolinesLifecycleCallbacks; |
| 41 | +import com.leanplum.callbacks.StartCallback; |
41 | 42 | import com.leanplum.callbacks.VariablesChangedCallback; |
42 | 43 | import com.leanplum.internal.ActionManager; |
43 | 44 | import com.leanplum.internal.Constants; |
@@ -534,7 +535,7 @@ static void openNotification(Context context, @NonNull Bundle notification) { |
534 | 535 | context.startActivity(actionIntent); |
535 | 536 | } |
536 | 537 | // Post handles push notification. |
537 | | - performPushNotificationAction(notification); |
| 538 | + performActionAfterIssuedStart(notification); |
538 | 539 | } |
539 | 540 |
|
540 | 541 | /** |
@@ -569,7 +570,7 @@ static void onActivityNotificationClick(@NonNull Bundle notification) { |
569 | 570 | } |
570 | 571 | return; |
571 | 572 | } |
572 | | - performPushNotificationAction(notification); |
| 573 | + performActionAfterIssuedStart(notification); |
573 | 574 | } |
574 | 575 | } |
575 | 576 |
|
@@ -633,7 +634,13 @@ public static void postHandlePushNotification(Context context, Intent intent) { |
633 | 634 | Log.d("Could not post handle push notification, extras are null."); |
634 | 635 | return; |
635 | 636 | } |
636 | | - performPushNotificationAction(notification); |
| 637 | + performActionAfterIssuedStart(notification); |
| 638 | + } |
| 639 | + |
| 640 | + private static void performActionAfterIssuedStart(@NonNull Bundle notification) { |
| 641 | + LeanplumInternal.addStartIssuedHandler(() -> { |
| 642 | + performPushNotificationAction(notification); |
| 643 | + }); |
637 | 644 | } |
638 | 645 |
|
639 | 646 | private static void performPushNotificationAction(@NonNull Bundle notification) { |
|
0 commit comments