mobile-messaging-sdk-android icon indicating copy to clipboard operation
mobile-messaging-sdk-android copied to clipboard

Notification behavior after removing app task

Open Arkadzi opened this issue 4 years ago • 25 comments

Steps: 1.Receive infobip notification 2.press home button 3.swipe app from tasks 4.notification remains visible (behaves like ongoing notification) 5.clicking on notification. 6.broadcast receiver has explicit intent for custom activity. after click nothing happens for few seconds, then launch activity appears (not the one explicitely intented), without any data. There must be some behavior either to make notification cancel after task removed, and then show it again after app launch, or behavior for running explicitely intented activity. Help please.

Arkadzi avatar Apr 15 '20 15:04 Arkadzi

Hi @Arkadzi, Sorry for the late response. We're checking the issue and will get back to you soon with the answer.

tjuric avatar May 06 '20 08:05 tjuric

Hello @tjuric,

Facing the similar issue and able to get the callback on BroadcastReceiver on tapping on the Notification after killing the app from the background.

Steps:

  1. Receive infobip notification
  2. press home button
  3. swipe app from tasks
  4. notification remains visible (behaves like ongoing notification)
  5. clicking on notification.
  6. On receive method of broadcast receiver is not called and the notification gets dismiss. So user gets stucks and not able to navigate to the application.

Help please on this scenario.

In AndroidManifest

<receiver
            android:name=".receiver.NotificationReceiver"
            android:exported="false">
            <intent-filter>
                <action android:name="org.infobip.mobile.messaging.NOTIFICATION_TAPPED" />
            </intent-filter>
        </receiver>

For some device like Realme Version 8.1, OnePlus 6, OnePlus 7T Pro Version 11 this broadcast receiver not getting trigger when application is killed from the background after receiving the notification and tapping on the notification which is visible in the notification tray.

pratikkukadia avatar Mar 31 '21 04:03 pratikkukadia

Hi @pratikkukadia, we will check it soon, thank you for reporting.

BR, Olga

riskpp avatar Mar 31 '21 13:03 riskpp

Hi @pratikkukadia , we checked the scenario on available devices and on different Android API versions, and can't reproduce it.

We used our deeplinking example for testing, just put logging at the beginning of the onReceive method and it's always presented in logcat.

May be you could test it like this, or may be provide some specific Android API version, where we could reproduce it?

In addition, for default notifications we use default priority channel option and don't use setOngoing, so notifications shouldn't behave like persistent notifications.

BR, Olga

riskpp avatar Mar 31 '21 16:03 riskpp

Could you please send your NotificationSettings, it could also help us to reproduce issue.

BR, Olga

riskpp avatar Mar 31 '21 17:03 riskpp

Hi @riskpp, below is the NotificationSettings

NotificationSettings.Builder(this)
                            .withMultipleNotifications()
                            .withDefaultIcon(R.drawable.ic_stat_notification)
                            .withColor(ContextCompat.getColor(this, R.color.colorAccent))
                            .build()

Infobip Sdk version : 4.3.1@aar.

The issue is of specific Realme Version 8.1, OnePlus 6, OnePlus 7T Pro Version 11 devices. I am having the Samsung device and it's working fine in that device.

So can you please check in the specific devices mention and also let me know in which devices have to tested the above scenario.

Thanks, Pratik

pratikkukadia avatar Apr 01 '21 09:04 pratikkukadia

Hi @pratikkukadia , while we are trying to find some of the devices you mentioned, could you please check do you also have such issue in our demo app from google play?

For now looks like the issue can be connected with

BR, Olga

riskpp avatar Apr 01 '21 13:04 riskpp

Hi @pratikkukadia, we checked the scenario on OnePlus 7 Pro and the issue isn't reproduced on our demo app.

BR, Olga

riskpp avatar Apr 02 '21 10:04 riskpp

Hi @riskpp, we have tested in OnePlus 7T Pro by installing your the demo app from google play? The issue is reproduced. We have recorded the video for your reference.

Please let us know if you need anything else.

PFA

https://user-images.githubusercontent.com/12750620/115560279-0ecbc800-a2d2-11eb-86a1-2265d4cd53f1.mp4

pratikkukadia avatar Apr 21 '21 13:04 pratikkukadia

Hi @pratikkukadia Could you please clarify, which Android version do you have on that device?

BR, Olga

riskpp avatar Apr 22 '21 13:04 riskpp

Hi @riskpp The Android version on OnePlus 7T Pro is version 11.

pratikkukadia avatar Apr 23 '21 05:04 pratikkukadia

Hi @pratikkukadia, we again tried to reproduce it on OnePlus 7 Pro after updating it to Android 11 with different battery optimization settings and closest thing we got is that, after we tapped on notification, app is opened after delay for 30sec-1min. In logs also nothing interesting was found, just previous process died and new one created with delay. Could you check, if after tapping on notification you will wait during 1 min, will application be opened or not? The exact case you mentioning we can't reproduce unfortunately.

BR, Olga

riskpp avatar Apr 26 '21 12:04 riskpp

Hi @riskpp, I have tried the steps you have mention and waited for about 1 and half mins but still the app does not get open. For your reference I have record a video for the same and attached it.

Please lets us know if u need anything else.

https://drive.google.com/file/d/1cIAI6EkTLrDxc66wslW8HPZRK-dXzjv9/view?usp=sharing

pratikkukadia avatar Apr 30 '21 09:04 pratikkukadia

Hi @pratikkukadia, Could you please send us screenshots of your settings in

  1. System > Developer options
  2. Settings > Battery > Battery optimization > <Select Application> Infobip Push

Hopefully it'll help us investigate this.

BR, Olga

riskpp avatar May 05 '21 08:05 riskpp

Hi @riskpp ,

Please find the attached screenshots of OnePlus 7T Pro

Screenshot_20210507-184026 Screenshot_20210507-183940

pratikkukadia avatar May 07 '21 13:05 pratikkukadia

Hi @riskpp We are waiting for an update from you. Can you please provide it ?

Thanks

hpatel123 avatar Jun 29 '21 12:06 hpatel123

Hi @hpatel123,

Unfortunately screenshots, you provided, didn’t help us to investigate the issue, for similar settings in our device infobip’s showcase application opens after tapping on notification (sometimes after delay). You could send us heap dump of the app after notification tapped, may be it could help.

BR, Olga

riskpp avatar Jun 30 '21 08:06 riskpp

Hi @riskpp we have provided video of issue along with device settings screenshots. Now your team has to debug it with the same device.

Note that in your sample application it is not working so you must look into this.

hpatel123 avatar Jun 30 '21 09:06 hpatel123

Thank you for the video, we definitely saw it, and debugged our showcase on exactly the same device with the same Android OS version (OnePlus 7 Pro with Android 11), but the closest thing we got is that after we tapped on notification app is opened after delay for 30sec-1min. Only thing we could propose you now is to get heap dump from your device when you tap on notification. Other idea of ours is to try to find one more device with the same settings and try to reproduce it. We will also try to reproduce it on another OnePlus 7 Pro with Android 11 device.

Just in case, if you didn’t try to restart the device, try it please.

BR, Olga

riskpp avatar Jun 30 '21 09:06 riskpp

Hi @riskpp Can you please post the video which shows that the notification tapping works fine even application is in kill mode ? Also please post the screenshots of device which shows Android version.

It would help us.

hpatel123 avatar Jun 30 '21 13:06 hpatel123

Hi @hpatel123, video and screenshot:

https://user-images.githubusercontent.com/8104718/124075505-a0338500-da4d-11eb-822f-18c01fb4827a.mp4

OnePlus7_Android11

riskpp avatar Jul 01 '21 06:07 riskpp

Is this issue still relevant, @hpatel123?

tjuric avatar Nov 23 '21 15:11 tjuric

@tjuric Looks like similar issue. We can still reproduce this issue.

hpatel123 avatar Dec 10 '21 05:12 hpatel123

@tjuric Is there any update on this?, still we are facing this issue when tapping on notification nothings happens. Device : Redmi9i with Android Version-10 Version : 6.2.0

pankaj89 avatar Nov 17 '22 09:11 pankaj89

Hi @pankaj89 unfortunately we are unable to reproduce the issue, you could try disable battery optimisation for the application, but for us on the OnePlus 7 it works even with it.

riskpp avatar Nov 17 '22 14:11 riskpp