Skip to content

Android: no beacons detected in background #4

@paolotremadio

Description

@paolotremadio

Hey,

I've got your lib installed on my app and what I do is:

  startScanning('UUID HERE', {
    useForegroundService: true,
    useBackgroundScanning: true,

    // Android only
    foregroundTitle: 'Location based automation is active',
    foregroundMessage: 'Checking location in the background to trigger automations',
  });

It works perfectly fine on iOS, I get updates both in foreground and background (that's because it's all handled by CoreLocation). On Android, I do get updates only with the app open in the foreground (that's with useForegroundService set to true or false, it doesn't matter).

My Expo Android permissions are:

[
        "android.permission.INTERNET",
        "android.permission.ACCESS_COARSE_LOCATION",
        "android.permission.FOREGROUND_SERVICE",

        "android.permission.ACCESS_FINE_LOCATION",
        "android.permission.ACCESS_BACKGROUND_LOCATION",
        "android.permission.RECEIVE_BOOT_COMPLETED",
        "android.permission.FOREGROUND_SERVICE_LOCATION",
        "android.permission.BLUETOOTH",
        "android.permission.BLUETOOTH_ADMIN",
        "android.permission.BLUETOOTH_SCAN",
        "android.permission.BLUETOOTH_CONNECT",
        "android.permission.VIBRATE"
]

Any clue on why it doesn't work in the background?

FYI: I've managed to get the plugin running on Expo SDK 50: fb7fb92 - feel free to port the changes in your repo.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions