Skip to content

Background location with Unity? #368

@ROBYER1

Description

@ROBYER1

Description:
Working on an app using your sdk that needs background location used to trigger location-based notifications on Android and IOS - the docs aren't quite clear on how this works with the Unity SDK
https://documentation.onesignal.com/docs/sdk-reference#promptlocation-method

Using OneSignal SDK 2.13.6 on Android 10 with Unity 2020.3.5f1, the request location access prompt we get when calling the functions below in start only allows ' Deny / Allow only while using the app' and no option for 'Allow access in the background'
OneSignal.SetLocationShared(true); OneSignal.PromptLocation();

I then went and did another build, this time editing the android.manifest file to include
<uses-permission android:name="android.permission.ACCESS_BACKGROUND_LOCATION" />

Now the dialogue requesting permission still doesn't request background access but we can configure it in the settings - apps - permissions on Android.

Are we doing something wrong, does OneSignal Unity SDK support background location and why does the triggered permission request not allow background location tracking?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions