pathsense-samples-android icon indicating copy to clipboard operation
pathsense-samples-android copied to clipboard

Notification is stuck

Open fouadchamoun opened this issue 8 years ago • 13 comments

Hello,

I've recently installed your SDK and noticed that the Pathsense notification shows up for a really brief time and then quickly disappears. However, sometimes the notification doesn't disappear and is stuck. I have to either kill the process or restart the phone to make it go away.

Do you have any idea why this could be happening ?

Thank you in advance,

Fouad

fouadchamoun avatar May 17 '16 13:05 fouadchamoun

Hi Fouad,

Thank you for your feedback. This is very helpful and important for making our SDK better!

In order to troubleshoot this issue, I have a few questions:

  • What device and OS does this happen on?
  • Is the API frozen (i.e. not providing responses)?
  • When you say stuck, do you mean the notification is always in the notification bar?
  • Does this occur when you relaunch your app from adb (i.e. Android Studio), or when you click the icon launcher?

Thank you, John Dyer

On May 17, 2016, at 6:34 AM, Fouad Chamoun [email protected] wrote:

Hello,

I've recently installed your SDK and noticed that the Pathsense notification shows up for a really brief time and then quickly disappears. However, sometimes the notification doesn't disappear and is stuck. I have to either kill the process or restart the phone to make it go away.

Do you have any idea why this could be happening ?

Thank you in advance,

Fouad

— You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub https://github.com/pathsense/pathsense-samples-android/issues/2

dyerjo avatar May 17 '16 14:05 dyerjo

Hi John,

  • This issue appeared a couple of times on a Nexus 4 running Stock Android Lollipop. It happened also once when I was testing run-time permissions on a Oneplus One running Android Marshmallow.
  • On the Oneplus, it happened when I disabled location permission for the app from settings menu. the notification came up in the notification drawer and didn't go away until I re-enabled the system permission.
  • On the Nexus 4, it happened randomly a couple of times but not because of a disabled permission as Android Lollipop uses "classic" permissions that are all enabled as soon as the app is installed.
  • As for the API being frozen, I didn't get to check that. I will as soon as it happens again on the Nexus 4. (I believe it would be definitely frozen on the Oneplus One if I disable the permission).
  • The notification stays in the notification drawer and you can't remove it as it's a persistent notification. Normally It would go away so fast I could only see the "ticker" and would never see it in the drawer.

Thank you again for your help,

Fouad

fouadchamoun avatar May 17 '16 15:05 fouadchamoun

Hi Fouad,

Great feedback!

The second scenario that triggers the notification on the Oneplus is a bug. We will provide a fix for that. Regarding, the Nexus 4, not sure what the issue is.

As for why the notification appears, it is a side-effect of the Pathsense SDK running as a foreground service. Particularly, in the latest Android releases, we have noticed the OS being more aggressive in terminating background services. Running as a foreground service gives us some level of protection.

You can customize both the notification and the ticker text to your own branding here:

https://developer.pathsense.com/node/778 https://developer.pathsense.com/node/778

Please, let me know if you have any more questions and/or issues.

Thank you, John Dyer

On May 17, 2016, at 8:21 AM, Fouad Chamoun [email protected] wrote:

Hi John,

This issue appeared a couple of times on a Nexus 4 running Stock Android Lollipop. It happened also once when I was testing run-time permissions on a Oneplus One running Android Marshmallow.

On the Oneplus, it happened when I disabled location permission for the app from settings menu. the notification came up in the notification drawer and didn't go away until I re-enabled the system permission.

On the Nexus 4, it happened randomly a couple of times but not because of a disabled permission as Android Lollipop uses "classic" permissions that are all enabled as soon as the app is installed.

As for the API being frozen, I didn't get to check that. I will as soon as it happens again on the Nexus 4. (I believe it would be definitely frozen on the Oneplus One if I disable the permission).

The notification stays in the notification drawer and you can't remove it as it's a persistent notification. Normally It would go away so fast I could only see the "ticker" and would never see it in the drawer.

Thank you again for your help,

Fouad

— You are receiving this because you commented. Reply to this email directly or view it on GitHub https://github.com/pathsense/pathsense-samples-android/issues/2#issuecomment-219752380

dyerjo avatar May 17 '16 16:05 dyerjo

Hi again !

I appreciate your help on this issue ! I understand the need for the notification as you use a foreground service. Actually the notification itself is not the problem because in normal cases it only shows up for a fraction of a second and I've customized it just in case.

Regarding the Nexus 4, the problem came up again yesterday and also just came up now as i'm writing this. The notification won't go away until I Force Close the app. Pathsense is still sending activity updates while the notification is stuck. I kill the app by Force Close (in settings menu) and Pathsense stops sending updates. Pathsense doesn't restart until I reopen the app.

What happened yesterday is that my colleague noticed that his phone kept the GPS activated long after he arrived home. The app deactivates GPS when it detects STILL, TILTING or ON_FOOT activity. I'm guessing that the GPS wasn't deactivated because Pathsense stopped working sometime while IN_VEHICLE and we didn't receive the change to STILL. But I'm also investigating any possible bugs on my side.

I can't really say what triggered the bug yesterday but I can tell you what just happened now. The app was open, no notification. I locked the screen (onPause). I turned on the screen without unlocking, no notification. Unlocked the screen back to app (onResume), no notification. Tapped the home button (onPause), notification came up immediately and won't go away.

Thank you again,

Fouad

fouadchamoun avatar May 18 '16 08:05 fouadchamoun

Hi Fouad,

What version of Android is running on the Nexus 4?

We will look into this.

Thank you, John Dyer

On May 18, 2016, at 1:07 AM, Fouad Chamoun [email protected] wrote:

Hi again !

I appreciate your help on this issue ! I understand the need for the notification as you use a foreground service. Actually the notification itself is not the problem because in normal cases it only shows up for a fraction of a second and I've customized it just in case.

Regarding the Nexus 4, the problem came up again yesterday. The notification wouldn't go away, and Pathsense wasn't sending any activity updates. Our app kept the GPS on and the battery got depleted because we didn't detect the transition from IN_VEHICLE to STILL (I guess Pathsense stopped working while IN_VEHICLE).

I'm going to implement a fail safe in order to detect this scenario and try to kill the process so that Pathsense would reinitialize. If you have any advice on how to correctly initialize Pathsense another way I would appreciate it.

Thank you again,

Fouad

— You are receiving this because you commented. Reply to this email directly or view it on GitHub https://github.com/pathsense/pathsense-samples-android/issues/2#issuecomment-219955329

dyerjo avatar May 18 '16 13:05 dyerjo

Stock Android 5.1.1

Thank you

fouadchamoun avatar May 18 '16 14:05 fouadchamoun

Hi again,

The same problem came up on a Samsung Ace 3 running CyanogenMod 11 (Android 4.4.4). The notification won't go away.

Thought I'd tell you about it. Don't hesitate if you need more information.

Have a good day,

Fouad

fouadchamoun avatar May 19 '16 08:05 fouadchamoun

Hi Fouad,

Was the API stuck as well on the Samsung Ace 3?

Thanks again, for the feedback. We will look into this.

John Dyer

On May 19, 2016, at 1:06 AM, Fouad Chamoun [email protected] wrote:

Hi again,

The same problem came up on a Samsung Ace 3 running CyanogenMod 11 (Android 4.4.4). The notification won't go away.

Thought I'd tell you about it. Don't hesitate if you need more information.

Have a good day,

Fouad

— You are receiving this because you commented. Reply to this email directly or view it on GitHub https://github.com/pathsense/pathsense-samples-android/issues/2#issuecomment-220255307

dyerjo avatar May 19 '16 16:05 dyerjo

we continued to receive activity updates but the notification wouldn't disappear

thank you John

fouadchamoun avatar May 19 '16 16:05 fouadchamoun

Hi there,

I am seeing the same issue on 2.3.0.12, Nexus 6P, Android 7.1.1, but works as intended on a Samsung Galaxy S4, Android 5.0.1. I would really like to ship an app with the Pathsense SDK, seeing as how it's much more accurate than Google's alternative, once this issue is resolved. Please let me know if you need any more information.

Thanks, Kahtaf

Kahtaf avatar Jan 03 '17 01:01 Kahtaf

Hi together,

I am using your PathSense API in one of my apps and an user complains, that the notification is not disappearing on his device! PathSense 2.3.0.18 Android 7.1.1 Device OnePlus 3T OxygenOS 4.1.0

What can it be?

Thanks Egmont

egmontr avatar Mar 21 '17 05:03 egmontr

Same issue in the last version of the SDK and Huawei P10. Android 8.0

npfernandeztheillet avatar Oct 30 '18 08:10 npfernandeztheillet

Same issue is occuring in version 3.2.0.0 with OnePlus 6 Android 9.0 Ozygen OS Beta 12

The notification shows permanently even when pathsense is running as background service

manav-mj avatar Feb 26 '19 13:02 manav-mj