status-im / status-mobile

a free (libre) open source, mobile OS for Ethereum
https://status.app
Mozilla Public License 2.0
3.86k stars 983 forks source link

Android issues with Notifications permissions #18251

Open mariia-skrypnyk opened 7 months ago

mariia-skrypnyk commented 7 months ago

Bug Report

Problem

This issue describes the behavior of the app when enabling push notifications both within the app (on onboarding and in profile) and in the device settings: it was discovered that notifications permissions behave differently on different devices, and in some cases, this leads to issues in the work of push notifications themselves.

Here are the main examples of undesirable behavior:

  1. Notification Permissions are enabled by default after Status app installation.
  2. No Notifications Permission Request popup on Onboarding screen.
  3. No Notifications Permission Request popup on Notifications settings of Status app if user want's to enable notifications he skipped on Onboarding screen.

At the moment, we observe the following behavior on some devices listed here

Expected behavior

  1. Notifications Permissions of Status app at the device settings should be disabled by default, especially from 13.0 android version , here we have a details :

Android 13.0, API level 33 Adds runtime permission. For your app to send notifications, the user must grant this permission to your app.

  1. User should see Notifications Permission Request popup on Onboarding screen after tap on Enable Notifications button
  2. User should see Notifications Permission Request popup on Notifications Settings screen inside Status app (Profile menu option) OR an ability to return to device settings and enable notifications there in case he skipped notification enabling on the Onboarding screen.

Actual behavior

  1. Notification permissions for the Status app at the device settings are enabled on some devices and disabled by default on others

https://github.com/status-im/status-mobile/assets/147824399/224320c8-387b-4f78-93bf-c961c83d25ff

https://github.com/status-im/status-mobile/assets/147824399/8760d596-cf02-416b-920e-3dfd689b1f0d

*list of the devices is mentioned here

  1. User doesn't see Notifications Permission Request popup on Onboarding screen after tap on "Enable notifications" button but he do have notifications while using app in case his device has notifications enabled by default at the device settings.
  2. User doesn't see Notifications Permission Request popup on Notifications Settings screen inside Status app (Profile menu option) when he turns "Show notifications" toggle on in case his device has notifications disabled by default at the device settings.

Reproduction

  1. Install build to the Android device
  2. Please take a look at cases with steps mentioned here

Additional Information

*this issue contains several moments that don't work as expected and grouping them may be helpful but in any case let me know if it is better do divide them

siddarthkay commented 7 months ago

Assigning this one to myself since I have very recent experience in the permissions domain

siddarthkay commented 5 months ago

Notable changes in the way Android OS has evolved since Android 13 -> https://source.android.com/docs/core/display/notification-perm#behavior-optin

siddarthkay commented 5 months ago

https://github.com/status-im/status-mobile/pull/18884 should fix case 1 in the excel sheet. Will take care of case 2 soon.

siddarthkay commented 2 months ago

Freeing this one up so that others can pick this up