react-native-android-location-enabler icon indicating copy to clipboard operation
react-native-android-location-enabler copied to clipboard

PoPup does not come in Android 10 version mobiles.

Open amit13091992 opened this issue 4 years ago • 3 comments

While using this library, the pop up doesn't come in Android OS 10. Tried in below devices:

Samsung M21 Poco X2

Can you please resolve or guide about this issue ASAP. Thanks

amit13091992 avatar Jul 29 '20 14:07 amit13091992

I can not reproduce this bug. I don't have those devices, so I tried on emulators : Nexus 5X API 29 Pixel XL API 30 It worked on both, do you have the same issue, with emulator or other devices ?

Richou avatar Aug 20 '20 20:08 Richou

@Richou Can you try it on real devices because many times, in emulator the location does not work properly.

amit13091992 avatar Sep 03 '20 17:09 amit13091992

The system considers your app to be using foreground location if a feature of your app accesses the device's current location in one of the following situations:

An activity that belongs to your app is visible. Your app is running a foreground service. When a foreground service is running, the system raises user awareness by showing a persistent notification. Your app retains access when it's placed in the background, such as when the user presses the Home button on their device or turns their device's display off.

Additionally, it's recommended that you declare a foreground service type of location, as shown in the following code snippet. On Android 10 (API level 29) and higher, you must declare this foreground service type.

<!-- Recommended for Android 9 (API level 28) and lower. -->
<!-- Required for Android 10 (API level 29) and higher. -->
<service
    android:name="MyNavigationService"
    android:foregroundServiceType="location" ... >
    <!-- Any inner elements would go here. -->
</service>
<manifest ... >
  <!-- To request foreground location access, declare one of these permissions. -->
  <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
  <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
</manifest>

On Android 10 (API level 29) and higher, you must declare the ACCESS_BACKGROUND_LOCATION permission in your app's manifest in order to request background location access at runtime. On earlier versions of Android, when your app receives foreground location access, it automatically receives background location access as well.

<manifest ... >
  <!-- Required only when requesting background location access on
       Android 10 (API level 29) and higher. -->
  <uses-permission android:name="android.permission.ACCESS_BACKGROUND_LOCATION" />
</manifest>

guitorioadar avatar Dec 14 '20 07:12 guitorioadar