android-pendingintent

How to send a request when push notification is cancelled in Android

本小妞迷上赌 提交于 2021-02-18 19:21:32
问题 When an application receives push notification from FCM , it calls onMessageReceived . (See 1, 2 or 3.) When a user taps the notification , it launches the applications, then it sends a request to a server that the user has read the notification. I want to know when a device received a push notification, but the user swiped it (or cleared all notifications). I want to send a request to the server that the user simply cancelled the notification . I tried to send BroadcastReceiver and show logs

Sending Extras to onReceive only retrieves ALARM_COUNT

笑着哭i 提交于 2021-02-10 07:03:19
问题 I made a custom view that sets an alarm with AlarmManager. I want to restore this view later so I'm trying to send the BroadcastReceiver several extras. The onReceive fails to retrieve anything but the ALARM_COUNT extra though. I've looked for a while and count find a solution. I've tried PendingIntent.FLAG.UPDATE.CURRENT multiple flags with the intent itself but nothing works. Is there a better way to restore a views state from a BroadcastReceiver? 回答1: "extras are all serialized into a byte

Sending Extras to onReceive only retrieves ALARM_COUNT

感情迁移 提交于 2021-02-10 07:01:21
问题 I made a custom view that sets an alarm with AlarmManager. I want to restore this view later so I'm trying to send the BroadcastReceiver several extras. The onReceive fails to retrieve anything but the ALARM_COUNT extra though. I've looked for a while and count find a solution. I've tried PendingIntent.FLAG.UPDATE.CURRENT multiple flags with the intent itself but nothing works. Is there a better way to restore a views state from a BroadcastReceiver? 回答1: "extras are all serialized into a byte

Push Notification Not Works Properly

徘徊边缘 提交于 2021-01-28 06:41:08
问题 I have created on Chatting Application in Android. In that I have problem occurs in Push Notification. Problem is: When User A Send Message to User X, so X gets the Push. After that User B Send Message to User X, so X gets second the Push. Then User X clicks on Push of User A Chat Screen not opens, but clicks on Push of User B Chat Screen opens. How to resolve this. PendingIntent contentIntent; UserSessionManager userSession = new UserSessionManager(context); if (type.equals("2")) { if