httpdispatch / MissedNotificationsReminder

Periodical sound reminder for missed notifications in Android OS.
74 stars 22 forks source link

Does not work with Android Work Profile #58

Open MrCaspan opened 3 years ago

MrCaspan commented 3 years ago

When I open the app on the personal side of my device it does not see work app notifications. So I installed the app on the work side of my device but when I do I get the error that it does not have access to notifications. So I click the "Manage Access" button and get the error "Notification access is not available for apps in the work profile"

Any clue as to how I would get reminder to work for work apps?

I have a Pixel 4a with Android 11 latest OS

MrCaspan commented 3 years ago

Not sure if this helps but maybe it seems the app installed can access notifications on the Work profile is allowed. I am the Admin for our Google MDM and I cannot find a way to whitelist Personal apps that can access work notifications. Also it looks like the app should be updated to use a new way to Poll for notifications to get both work and personal and a way to test

https://developer.android.com/work/managed-profiles

httpdispatch commented 3 years ago

I'm not sure that third party app can whitelist itself to receive notifications from work profile. As I've read you should do it in some profile management tool

MrCaspan commented 3 years ago

Its weird it seems like NotificationListenerService is ignored in the work profile as it does not exist, but you cant access work notifications from the personal side unless your admin approves it. Well I am the admin and there is NO WHERE that I can approve that this app is allowed to see notifications from the work profile. I'm just curious if the devs have any other options or ideas because I use this app for work notifications and its kind of useless if I cannot use it in a work profile. As well maybe they shoudl add some code to test for this to let the user know it wont work because its running in a work profile.

httpdispatch commented 3 years ago

How about accessibility service, does it work with work profile notifications? You may try to download accessibility service version manually from releases page

MrCaspan commented 3 years ago

All I get is the error you cannot install this app on the device using that version.

httpdispatch commented 3 years ago

You should remove current version first, because accessibility service version has lower version number

MrCaspan commented 3 years ago

Okay so that is weird.. Not sure if this is not programmed right or if its exactly as it should be.

So I had to uninstall the work app and the personal app then install the accessibility version on both work and personal sides of my device. you must install it on the personal side if you want the work side to get access to notifications because when you request notification access it brings up the personal side accessibility settings and the OS wont show the Missed app in the list unless you have it installed on the personal side. So even if you only plan on using it for the work side of your device you still need it in both places.

I am now able to get Missed Notifications from the work side of my device and the personal side of my device I just have to set up the app twice to have the same settings. Not sure I understand how it is working but it is working!!

Thanks for the help and where is the "Buy me a beer" link for this app as I cannot live without it and want to support the devs!

httpdispatch commented 3 years ago

In the menu there is a contribute button. But it works only via Google play purchases so I think the app have to be installed from the play store to pay that way. Another option is bitcoin wallet 1EvnfWVKjLVPV8BXuird5MMyedx39zAGyf

But don't hurry, please monitor whether the app works stable for a week or so.

catthou commented 1 year ago

I'm having the same issue. Is "MissedNotificationReminder-accessibility-v14-release-v1.6.5.apk" the one I need? Or do I also need the accompanying notificationListener from that post?

httpdispatch commented 1 year ago

@catthou here you may download the latest accessibility version

catthou commented 1 year ago

Lost my big report to a power outage so here's an abreviated version I guess...

Did as the previous poster:

So I had to uninstall the work app and the personal app then install the accessibility version on both work and personal sides of my device. you must install it on the personal side if you want the work side to get access to notifications because when you request notification access it brings up the personal side accessibility settings and the OS wont show the Missed app in the list unless you have it installed on the personal side. So even if you only plan on using it for the work side of your device you still need it in both places.

But this did not work. I then went and allowed file system access for both work profile and main, in case it was issue of not being able to read the sound to play - this was not necessary if just using MNR on main. Even so, reminders for work profile don't function. I set the sounds different so I'd know it was for sure the work profile, but still didn't get any reminders. Tried different apps in work profile - google voice, discord, sms... main profile works fine, but cannot get work profile to give me reminders.

Not sure what to try next!

httpdispatch commented 1 year ago

@catthou not sure how exactly the work profile works. You may check logs in the app which is installed for the work profile whether it receives any events about any posted notifications (Menu -> Show logs)

catthou commented 1 year ago

The logs for the work profile MNR don't show any of the notification messages like the MNR in the main profile, so I guess page linked earlier is right:

When your app is running in a work profile, the system ignores your app's NotificationListenerService. However, apps running in the personal profile can listen for notifications.

But I thought accessibility version of this app somehow gets around using NotificationListenerService? Accessibility version of MNR in work profile doesn't show any onAccessibilityEvent logs like the main profile one does.

Anyways, later, about the main profile it says:

When your app runs in the personal profile, you might not get notifications for apps running in the work profile. By default, all personal profile apps receive callbacks but an IT admin can allowlist one or more personal profile apps that they allow to listen for notification changes.

I'm not exactly sure what this means technically, but I have two ideas:

I wonder if adding a toggle under "Applications to Monitor for Missed Notifications" for "Listen to All Applications" instead of using the list would be able to make it work just being installed in main profile. Maybe not. But a discord notification in work profile does trigger an accessibility event in the log of main-profile MNR and it could read the appname that sent it. There was also an error but it's not so easy to dump the log to clipboard or text file...

I also wonder what version of android and what profile-management app @MrCaspan was using...