There is the following code for sending push notifications:
private static final String channelId = "default_notification_channel_id"; Intent intent = new Intent(this, ViewPredl.class); intent.putExtra("dp", dp); PendingIntent pendingIntent = PendingIntent.getActivity(this, 0, intent, PendingIntent.FLAG_UPDATE_CURRENT); Uri notificationSound = RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION); NotificationCompat.Builder notifiBuilder = new NotificationCompat.Builder(this, channelId) .setSmallIcon(R.mipmap.ic_launcher) .setColor(Color.GRAY) .setContentTitle(title) .setContentText(body) .setTicker(title) .setLights(Color.GREEN, 500, 1000) .setAutoCancel(true) .setSound(notificationSound) .setContentIntent(pendingIntent); NotificationManager notificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE); notificationManager.notify(notifz, notifiBuilder.build()); It would be desirable that when sending a notification to work as follows: I send a notification, the activation is opened and the dp values are sent there, I send the second notification when I click it, the activation is opened and other values are passed there dp
At the moment I get the correct values in the notification, and when I click on the activation notification, it does not open, only one opens.
Which PendingIntent flag should I set? (PendingIntent.FLAG_UPDATE_CURRENT installed)
Do I need to send different notifz every time or is it enough to put 0?
channelId every time you need a different or can you be permanent?