Skip to content

Commit da2b058

Browse files
authored
fix(pinpoint): Fix GCM (Not FCM) Android 12 trampolining (#3109)
1 parent c3e6d69 commit da2b058

File tree

1 file changed

+8
-10
lines changed

1 file changed

+8
-10
lines changed

aws-android-sdk-pinpoint/src/main/java/com/amazonaws/mobileconnectors/pinpoint/targeting/notification/GCMNotificationClient.java

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -53,16 +53,14 @@ protected PendingIntent createOpenAppPendingIntent(final Bundle pushBundle, fina
5353
flags |= PendingIntent.FLAG_IMMUTABLE;
5454
}
5555

56-
if (intentAction.equals(NotificationClient.GCM_INTENT_ACTION)) {
57-
contentIntent = PendingIntent.getService(pinpointContext.getApplicationContext(), requestId,
58-
this.notificationIntent(pushBundle, eventSourceId, requestId, NotificationClient.GCM_INTENT_ACTION,
59-
targetClass), flags);
60-
} else {
61-
contentIntent = PendingIntent.getActivity(pinpointContext.getApplicationContext(), requestId,
62-
this.notificationIntent(pushBundle, eventSourceId, requestId, NotificationClient.FCM_INTENT_ACTION,
63-
targetClass), flags);
64-
PinpointNotificationActivity.setNotificationClient(this);
65-
}
56+
String updatedAction = intentAction.equals(NotificationClient.GCM_INTENT_ACTION) ?
57+
NotificationClient.GCM_INTENT_ACTION : NotificationClient.FCM_INTENT_ACTION;
58+
59+
contentIntent = PendingIntent.getActivity(pinpointContext.getApplicationContext(), requestId,
60+
this.notificationIntent(pushBundle, eventSourceId, requestId, updatedAction,
61+
targetClass), flags);
62+
63+
PinpointNotificationActivity.setNotificationClient(this);
6664
return contentIntent;
6765
}
6866
}

0 commit comments

Comments
 (0)