react-native-background-geolocation icon indicating copy to clipboard operation
react-native-background-geolocation copied to clipboard

Allow to customise android-permissions background notification

Open zatteo opened this issue 1 year ago • 3 comments

Hi,

Thank you for your work. Here is a small feature request related to Android permission notification in background.

On Android, if :

  • app goes in foreground
  • you allow all needed permissions
  • app run startTracking()
  • app goes in background
  • you disallow location permission in app settings
  • geolocation is triggered in background

A default permission notification is displayed by android-permissions, the library you used to manage permissions. It was not possible to customise it before (as you said in this issue), but since android-permissions 2.1.6 it is.

So could you support this notification customisation ?

Thank you.

Your Environment

  • Plugin version: 4.13.3
  • Platform: Android (LineageOS)
  • OS version: 13
  • Device manufacturer / model: Pixel 6a
  • React Native version (react-native -v): 0.66
  • Plugin config
{
      desiredAccuracy: BackgroundGeolocation.DESIRED_ACCURACY_HIGH,
      showsBackgroundLocationIndicator: false,
      distanceFilter: 20,
      elasticityMultiplier: 2,
      locationUpdateInterval: 10000,
      stationaryRadius: 50, 
      stopTimeout: 10,
      debug: false, 
      logLevel: BackgroundGeolocation.LOG_LEVEL_DEBUG,
      startOnBoot: true,
      batchSync: false,
      autoSync: false, 
      stopOnTerminate: false,
      enableHeadless: true,
      foregroundService: true,
      backgroundPermissionRationale: {
        message: t(
          'services.geolocationTracking.androidBackgroundPermissionMessage'
        )
      },
      notification: {
        title: t('services.geolocationTracking.androidNotificationTitle'),
        text: t('services.geolocationTracking.androidNotificationDescription'),
        smallIcon: 'mipmap/ic_stat_ic_notification'
      }
    }

Expected Behavior

A custom icon + title + message for the background permission notification like https://transistorsoft.github.io/react-native-background-geolocation/interfaces/config.html#notification

Actual Behavior

image

Steps to Reproduce

  1. app goes in foreground
  2. you allow all needed permissions
  3. app run startTracking()
  4. app goes in background
  5. you disallow location permission in app settings
  6. geolocation is triggered in background

Context

/

Debug logs

zatteo avatar Nov 28 '23 14:11 zatteo

In emulator i can see the notification but in real device (android version:13) i can't see the notification

SurajMohanty02 avatar Dec 05 '23 12:12 SurajMohanty02

Hi @christocracy, did you get a chance to look at my issue?

zatteo avatar Dec 12 '23 13:12 zatteo

That is something that would be very nice to have, if you think this is possible @christocracy :pray:

paultranvan avatar Dec 22 '23 16:12 paultranvan

This issue is stale because it has been open for 30 days with no activity.

github-actions[bot] avatar Apr 19 '24 01:04 github-actions[bot]

This issue was closed because it has been inactive for 14 days since being marked as stale.

github-actions[bot] avatar May 03 '24 01:05 github-actions[bot]