From 40da6bcf31734693b99040efa37d4b72f9d4de70 Mon Sep 17 00:00:00 2001 From: HarelM Date: Tue, 28 May 2024 23:13:20 +0300 Subject: [PATCH] Move the request for notification pemissions to a different flow. --- .../marianhello/bgloc/BackgroundGeolocationFacade.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/android/common/src/main/java/com/marianhello/bgloc/BackgroundGeolocationFacade.java b/android/common/src/main/java/com/marianhello/bgloc/BackgroundGeolocationFacade.java index 320f834e..87f332cb 100644 --- a/android/common/src/main/java/com/marianhello/bgloc/BackgroundGeolocationFacade.java +++ b/android/common/src/main/java/com/marianhello/bgloc/BackgroundGeolocationFacade.java @@ -56,7 +56,6 @@ public class BackgroundGeolocationFacade { public static final String[] PERMISSIONS = { Manifest.permission.ACCESS_COARSE_LOCATION, Manifest.permission.ACCESS_FINE_LOCATION, - Manifest.permission.POST_NOTIFICATIONS, }; private boolean mServiceBroadcastReceiverRegistered = false; @@ -235,6 +234,13 @@ public void onPermissionDenied(DeniedPermissions deniedPermissions) { } } }); + permissionManager.checkPermissions(Arrays.asList(Manifest.permission.POST_NOTIFICATIONS), new PermissionManager.PermissionRequestListener() { + @Override + public void onPermissionGranted() {} // noop + + @Override + public void onPermissionDenied(DeniedPermissions deniedPermissions) {} // noop + }); } public void stop() {