Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Proximity is not working on Android 11 #105

Open
1 task done
mayurvashishtha opened this issue Apr 5, 2021 · 1 comment
Open
1 task done

Proximity is not working on Android 11 #105

mayurvashishtha opened this issue Apr 5, 2021 · 1 comment

Comments

@mayurvashishtha
Copy link

Prerequisites

  • Put an X between the brackets on this line if you have done all of the following:
    • My beacons have Estimote Monitoring enabled (Check it in the Estimote Cloud, or via app)
    • My Android device/devices supports BLE and has Android OS version >= 5.0.0
    • My Android device/devices have bluetooth enabled
    • My app has Location Permissions granted

Basic information

Estimote SDK version: com.estimote:proximity-sdk:1.0.5, com.estimote:scanning-plugin:0.25.4

Android devices affected: SM-G975F/DS

Android OS version affected: Android 11

Beacon hardware version: J1.9_B1.1

Description

Proximity is not working on Android 11

Expected behavior: It should detect onEnter(), onExit() events

Actual behavior: Not working

Additional information

Add here any logs you want to attach, or any other info, like pictures for example
@daniel-cotton
Copy link

daniel-cotton commented Nov 3, 2021

I've managed to get proximity working on an app targeting API 30 (Android 11)

Steps I took to fix this were

Ensure I had "fine" location permissions granted at runtime + included in app manifest

<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>

Ensure I had granted location permissions to the Estimote foreground service
Android API 29+ appears to require an explicit declaration for foreground services that access specific permissions
https://developer.android.com/guide/components/foreground-services#loc-camera

I appended this service to my android manifest (basically de-compiled my own app to extract the merged manifest, then extracted the estimote service declaration and appended the foregroundServiceType attribute)

   <service android:enabled="true" android:exported="false" android:name="com.estimote.scanning_plugin.packet_provider.service.PacketProviderWrapperService"
       android:foregroundServiceType="location"/>

This is working for me, both with the UI in the foreground and with the UI in the background (with running notification / foreground service)

Tested on Pixel 6 (Android 12) + Pixel 3 XL (Android 11)

Hope this helps!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants