Not showing on Lock Screen on some devices
Hi, thanks for this great app.
Unfortunately, I'm one of those who faced the issue on not showing the notifications right out of the box (Meizu M6 Note, Android 7.1). Never on the lock screen, but almost always on the notification drawer screen. I saw some reviews at the Play Store with similar experience. I tried all released versions (release7.apk - release11.apk) with the same results. I tried to look at the sources, eventlog and play with different settings. Finally, when the Dismissable Notes setting was set on, the notifications appeared on the Lock Screen.
My guess is that some devices with custom logic behind notifications might not like the SetAutoCancel(true)/SetOngoing(true) at the same time (AutoCancel is true in the getNotesBuilder method and SetOngoing is true when the notifications are not dissmissible - default for newly installed app). I could not find a related discussion about these two calls at stackoverflow.com or anywhere else, but it's just a guess, but very few code fragments about other topics contains both as true. Even looking at the docs they look mutually exclusive ( docs about Notification.Builder )
public Notification.Builder setOngoing (boolean ongoing) Set whether this is an "ongoing" notification. Ongoing notifications cannot be dismissed by the user public Notification.Builder setAutoCancel (boolean autoCancel) Make this notification automatically dismissed when the user touches it.
I'm not sure that this should be fixed, but you may consider adding some notes to the description in the Store.
(Side note: I'm going to use your app extensively since there are virtually no other at the Store, the only direct "competitor" (studios.applab.stickynotifications) is too simple for daily use (but works right of the box :)
Thanks
Dear @Codereamp
Thank you very much for this information. I will look into this and get back to you! This app is long overdue for an update. :)
As per the description, this App is a solo project from way back when. Please be mindful, that it may take me some time to implement your suggestions.
Another hunch I am having is, that on newer / non-native Android versions, there is a permission to show notifications. This may be set to false per default on fresh installs. See: https://developer.android.com/about/versions/13/changes/notification-permission
Thus, asking for permissions may be required. Shout out for the scummy (notification-spammy) apps, ruining it for everyone else.
Also thank you for your kind words. There are some competitors and copy cats of this app, as I am aware of. Glad to hear they are working ( but are they free, open source and harvest no user data?) 😄 Regardless, I am trying my best to provide a great user experience, but am limited by my free time.
Cheers!
Thanks. If you find time it will be great, if not - no big deal, as I mentioned with dismissable notes everything works find.
Some additional considerations at the moment if you don't mind.
- I suppose you will have difficulty finding exotic devices like mine. I'm ready to test any deviation version you might suggest for checking one possible fix or another.
- Knowing that in my case it's just some not well-known brand an model, I looked at the reviews of the app. The page stated that the number of reviews is 180, but I managed to get only 55, anyway, the named models from this list (when users not just stated that the app didn't work, but mentioned the model) was Samsung S3 Neo and Samsung j5.
- Trying to test some other app with similar calls, I googled [ site:github.com "SetOngoing true" "SetAutoCancel true" ], one of found is Simple-Voice-Recorder, I installed it, it is supposed to show recording notifications when the recording is started and on my device the badge also appeared in the drawer, but not on the lock screen. Sure, it's evidence but not completely fair :)
- Sure I was wrong suggesting that AutoCancel and Ongoing are mutually exclusive, because AutoCancel as it appears not just for dismissing on tap but also for navigating to the app (this is the case in your app indeed). I also have a plenty of apps that both can jump to the app on tap and allow dismissing by horizontal swapping. For example, Google Calendar. They might just implement a little different set of calls. ....
Thanks
Hey, so I did some research and some work. Here's the gist:
I found out that newer Android versions have two kind of permission checks. One is the "POST_NOTIFICATIONS" permission in the manifest. The other is from the notification center. I have implemented a check for both in this function. As far as my testing is concerned I can now detect if the app has insufficient permissions. And if so, it will display a warning (and instructions on how to grant permissions) in the main menu. I do hope this will make things clearer for users in the future. I do think that these permissions might not be granted at some cases (or off by default) and thus no notifications are displayed.
To answer your points:
- Thank you, this is much appreciated. If you can compile the app yourself, feel free to check if it works now. If not, let me know and I can provide a debug compile of the current state.
- Yea I am kinda bound by the implementations of the android SDK. If some device manufactures decide to play things differently I have no control over that. :(
- Thank you for providing that! I will look into it, but same applies as mentioned above.
- All good. Maybe there is something you can do yourself with the settings? You can go to the app settings and customize the notifications to be dismiss-able. Maybe any combination of the in-app settings yields a better result?
I am still planning to implement further changes and UI updates before going live. Thanks for your help so far!
Thanks for the info and the change.
I managed to compile the current version and test it on the device (Meizu M6 Note, Android 7.1). The result is the same, so there was no any notification on the lock screen, but it existed in the drawer. And not special messages or warnings.
I find another (commerical) app probably suffering on my device. AccuBattery has a always present info notification, by default in the drawer but not on the lock screen. From how it behaves, it is also clickable to navigate to the app (so probably setAutoCancel(true)) and undissmisable by default (so SetOngoing(true)), but they also have a dedicated setting for allowing showing this notification in the lock screen ("show on secure lock screen", probably just calling setLockscreenVisibility with the public visibility). And setting this setting to true doesn't change anything, no notification appears on the Lock Screen, still only in the drawer.
So, probably there is (or was) a bug in this device, not allowing having tappable and non-dismissable notifications at the same time.
Thanks for compiling and checking the app.
I am a bit confused myself. I think I have implemented the checks correctly. As far as I know there are two hurdles for a notification to be displayed:
- The Notification Channel Settings
- The app's permission to display notifications at all
And I have checked for both.... If one of those fail, you get a menu item reminding you to review permissions (as that needs to be done manually. I cannot grant myself permissions).
As seen here, I set the default visibility settings to "public" when creating a notification channel (this was already previously implemented):
https://github.com/NilsFo/LockScreenNotes/blob/f2598543f80a2029a2577463b45f40f418ba7c1a/app/src/main/java/de/nilsfo/lockscreennotes/util/NotificationChannelManager.java#L55
As stated, I do setAutoCancel(true)). But that only removes the notification from the drawer when it's clicked. And setOngoing(true)) makes it that the user cannot dismiss the notification by swiping it away. The SetOngoing flag can be configured in the app's settings (see below).
So you say that you "passed" the above mentioned permission checks. And you do not get notifications on the lock screen, but if you pull the drawer down, you can see them? Could you do one final thing and check the app's settings? From the main activity, please navigate as follows: Settings -> Notifications and when you scroll down you'll see entries for "High Priority notifications" and "Subtile notifications". What of those are checked? Does anything change if you enable high priority notifications? Does anything change if you toggle dismissable notifications?
Sorry, more and more I think that this is in this particular brand/android version. It is well known that Chinese manufacturers customize the default android code base extensively so some side bugs might appear.
As for your questions
So you say that you "passed" the above mentioned permission checks. And you do not get notifications on the lock screen, but if you pull the drawer down, you can see them?
Yes, but with a catch. Only when I unlock the phone then the pulled down drawer will show the notification, pulling down from the lock screen doesn't reveal anything new.
.... entries for "High Priority notifications" and "Subtile notifications". What of those are checked?
Both seems to be unchecked by default. Anyway, any attempt to change them still doesn't affect the notification visibility
Does anything change if you toggle dismissable notifications?
Dismissable notifications setting DOES fix the issue so right after I set it to On, I start seting my notifications at the lock screen. I mentioned this before, but probably didn't make myself clear. That's why I thought that this particular mix of notifications adjustments (setOngoing/SetAutocancel with true/true) leads to the buggy state only on my device. Indirect evidence came from two apps I mentioned, one open-sourced recorder where this true/true was explicitly set and one commercial (AccuBattery) when I didn't have access to sources, but according to how the notifications behave, the settings was also probably true/true, and obviously the notification was supposed to appear on the lock screen, but it didn't.
On other devices the problems can indeed be related to the permissions settings, so your new fix for detecting this might help other users.
Hi Codereamp, After a whole lot of work, I am back at tackling this issue. Thanks for the patience.
I must admit, I am very puzzled with the situation. I don't really know what I / we can do at this moment. Thanks very much for all the effort you put into all this so far!!
Maybe we are both confusing each other? Do you use other apps with similar behaviour that are clickable and dismissed when doing so? Do you think if I auto set that option on your kind of device, that will solve the issue?
Otherwise I don't really know what I can do at this moment... Or maybe there is a device emulator out there I could try? You seem to be quite knowledgeable and an expert at this. Do you think you could fix it in the source code so it works on your device and we will merge the changes for the next update?
Hi, NilsFo
Thanks that you don't forget about this issue. But I still tend to think that it's this android variation issue, somehow overlooked by the developers. Other apps suffer too, for example, AccuBattery tries to show the badge with its data on the lock screen (with the corresponding setting on) and fails. Since this is probably this model/OS specific issue, I'm ok with the fact that I should check "Dissmisable notification" setting, no need to set it on by default. I think you can safely close this issue (or I can do this, I see "Close as not planned ..." below).
By the way, the more I use your app the more I like it, Google Calendar is used less and less to everyday notifications. It's not an issue, but a praise, unfortunately github doesn't have such entities to open, so I type it here hoping it's not against the rules :)
Some little off-topic inconvenience, so probably should open another ticket or you maybe just hint me on this. The notes won't return after the restart so I have to start the app manually every time the device restarts. Not a big deal so if it's my design then I'm content with it. But if it's something that should work but fails on my device or may be not working now, but might be planned for future, it would be great.