Skip to content

Commit

Permalink
fix jump action not working
Browse files Browse the repository at this point in the history
  • Loading branch information
NihilityT committed Jan 8, 2023
1 parent d4dd856 commit 41efec1
Showing 1 changed file with 8 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,6 @@ private static void addDebugAction(Context xmPushService, XmPushActionContainer
PendingIntent pendingIntent = PendingIntent.getActivity(xmPushService, 0, sdkIntentJump, PendingIntent.FLAG_UPDATE_CURRENT);
localBuilder.addAction(new NotificationCompat.Action(i, "SDK Intent", pendingIntent));
}

}
}

Expand Down Expand Up @@ -406,24 +405,26 @@ private static PendingIntent startServicePendingIntent(Context paramContext, XmP
if (paramPushMetaInfo == null) {
return null;
}
PendingIntent localPendingIntent;

Intent localIntent;
if (isBusinessMessage(paramXmPushActionContainer)) {
Intent localIntent = new Intent();
localIntent = new Intent();
localIntent.setComponent(new ComponentName("com.xiaomi.xmsf", "com.xiaomi.mipush.sdk.PushMessageHandler"));
localIntent.putExtra(PushConstants.MIPUSH_EXTRA_PAYLOAD, paramArrayOfByte);
localIntent.putExtra(FROM_NOTIFICATION, true);
localIntent.addCategory(String.valueOf(paramPushMetaInfo.getNotifyId()));
localPendingIntent = PendingIntent.getService(paramContext, 0, localIntent, PendingIntent.FLAG_UPDATE_CURRENT);
} else {
Intent localIntent = new Intent("com.xiaomi.mipush.RECEIVE_MESSAGE");
localIntent = new Intent(PushConstants.MIPUSH_ACTION_NEW_MESSAGE);
localIntent.setComponent(new ComponentName(paramXmPushActionContainer.packageName, "com.xiaomi.mipush.sdk.PushMessageHandler"));
localIntent.putExtra(PushConstants.MIPUSH_EXTRA_PAYLOAD, paramArrayOfByte);
localIntent.putExtra(FROM_NOTIFICATION, true);
localIntent.addCategory(String.valueOf(paramPushMetaInfo.getNotifyId()));
localPendingIntent = PendingIntent.getService(paramContext, 0, localIntent, PendingIntent.FLAG_UPDATE_CURRENT);
}
return localPendingIntent;
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
return PendingIntent.getForegroundService(paramContext, 0, localIntent, PendingIntent.FLAG_UPDATE_CURRENT);
} else {
return PendingIntent.getService(paramContext, 0, localIntent, PendingIntent.FLAG_UPDATE_CURRENT);
}
}

/**
Expand Down

0 comments on commit 41efec1

Please sign in to comment.