You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When trying this solution final code on my phone (running with Android N), I ran into some issues which made the app crash:
Some packages in the GeofenceBroadcastReceiver file have not been imported, so that it does not let compile.
The permission for the ACCESS NOTIFICATION POLICY is not present in the Manifest.xml file.
Since when we want to change the Ringer mode we want to make sure that Notification Policy Access is granted (in case our SDK is 24 or greater), I think the appropriate code should be:
thanks all but i still have an issue with the ringer issue, when the geofences switch is disabled the silent mode does not get disabled and the phone still continue on silent mode? any suggestion ?
Hi!
When trying this solution final code on my phone (running with Android N), I ran into some issues which made the app crash:
Some packages in the GeofenceBroadcastReceiver file have not been imported, so that it does not let compile.
The permission for the ACCESS NOTIFICATION POLICY is not present in the Manifest.xml file.
if (android.os.Build.VERSION.SDK_INT < 24 ||
(android.os.Build.VERSION.SDK_INT >= 24 && nm.isNotificationPolicyAccessGranted()))
...
and not
if (android.os.Build.VERSION.SDK_INT < 24 ||
(android.os.Build.VERSION.SDK_INT >= 24 && !nm.isNotificationPolicyAccessGranted()))
...
I actually removed the "!", since in the current version of the code we try to change the Ringer mode status when the permission is not granted...
Thanks for your great tutorials guys!
Kind regards,
Gaël
The text was updated successfully, but these errors were encountered: