Skip to content

Commit

Permalink
Change the way the initial notification is extracted from intent at a…
Browse files Browse the repository at this point in the history
…pplication startup
  • Loading branch information
mobile1-internal authored and Christophe BARATAY committed Jul 17, 2023
1 parent c877f54 commit 62f2cd8
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -95,11 +95,13 @@ private void callOnOpenedIfNeed(Activity activity) {
Intent intent = activity.getIntent();
if (NotificationIntentAdapter.canHandleIntent(intent)) {
Context appContext = mApplication.getApplicationContext();
Bundle notificationData = NotificationIntentAdapter.canHandleTrampolineActivity(appContext) ?
intent.getExtras() : NotificationIntentAdapter.extractPendingNotificationDataFromIntent(intent);
Bundle notificationData = intent.getExtras();
final IPushNotification pushNotification = PushNotification.get(appContext, notificationData);
if (pushNotification != null) {
pushNotification.onOpened();
// Erase notification intent after using it, to avoid looping with the same notification
// in case the app is moved to background and opened again
activity.setIntent(new Intent());
}
}
}
Expand Down

0 comments on commit 62f2cd8

Please sign in to comment.