Skip to content

Commit

Permalink
compatible for android 12 within leancloud push notification
Browse files Browse the repository at this point in the history
  • Loading branch information
jwfing committed Jun 9, 2022
1 parent 4c6cad8 commit 0df647c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,8 @@ private void sendNotification(String from, String msg, Intent resultIntent) {
ComponentName cn = new ComponentName(context, clsName);
resultIntent.setComponent(cn);
PendingIntent contentIntent =
PendingIntent.getActivity(context, notificationId, resultIntent, 0);
PendingIntent.getActivity(context, notificationId, resultIntent,
PendingIntent.FLAG_UPDATE_CURRENT | PendingIntent.FLAG_IMMUTABLE);
String sound = getSound(msg);
Notification notification = null;
if (Build.VERSION.SDK_INT <= Build.VERSION_CODES.N_MR1) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,8 @@ private void sendNotification(String from, String msg, Intent resultIntent) {
ComponentName cn = new ComponentName(context, clsName);
resultIntent.setComponent(cn);
PendingIntent contentIntent =
PendingIntent.getActivity(context, notificationId, resultIntent, 0);
PendingIntent.getActivity(context, notificationId, resultIntent,
PendingIntent.FLAG_UPDATE_CURRENT | PendingIntent.FLAG_IMMUTABLE);
String sound = getSound(msg);
String title = getTitle(msg);
String notificationChannel = getNotificationChannel(msg);
Expand Down

0 comments on commit 0df647c

Please sign in to comment.