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

Add support of Android 12 (Google API 31) #474

Open
AEiosApp opened this issue Oct 19, 2022 · 21 comments
Open

Add support of Android 12 (Google API 31) #474

AEiosApp opened this issue Oct 19, 2022 · 21 comments

Comments

@AEiosApp
Copy link

Build fails for Android, when trying to to build with targetSDKVersion 31

Was able to make it working after updating org.altbeacon:android-beacon-library to latest version 2.19.3

Please, update dependecy

image

@radoslavirha
Copy link

Please update it :) Thanks

@radoslavirha
Copy link

@AEiosApp I opened PR with new version. Temporarily you can switch to my repo (remove, add new cordova plugin).

I just bumped versions, I'm not sure about consequences.... But it's working and google finally accepted my app.

@AEiosApp
Copy link
Author

AEiosApp commented Nov 6, 2022

@Radik24 Thanks!

This will let us build app for API 31 , but looks like we have to avoid using this plugin on Android 12 devices.

My code works perfect for iOS and Android 11 device, but wasn't able to make it work on Android 12 device.

#1 Enable Bluetooth doesn't work on Android 12
cordova.plugins.locationManager.enableBluetooth()

#2 There are plenty of fresh issues reports on the org.altbeacon:android-beacon-library page (in closed state, but not sure if resolved)
https://github.com/AltBeacon/android-beacon-library/issues?q=is%3Aissue+12+is%3Aclosed

I think my solution for now will be to check Android version on the device and not to use this feature on Android 12 devices

@radoslavirha
Copy link

@AEiosApp I still have some issues with BLUETOOTH_SCAN on android 12. Do you know how to fix it? Thanks

@AEiosApp
Copy link
Author

@Radik24 nope, I checked all related issues posts on the github of android-beacon-library, but look like they don't have any solution yet for Android 12

@noahbaron
Copy link

noahbaron commented Nov 19, 2022 via email

@radoslavirha
Copy link

Hi, I got it. It works fine. But I combine it with cordova-plugin-eddystone which is not working. So my bad. At least app starts. I must to try it with real beacons if it's working.

@AEiosApp
Copy link
Author

@noahbaron did you try it on device with Android 12?
It works fine for me on Android 11 device, but not on Android 12

@radoslavirha
Copy link

just on simulator, I don't have Android 12. I'll send it to my colleague with Android 12

@noahbaron
Copy link

noahbaron commented Nov 19, 2022 via email

@AEiosApp
Copy link
Author

Thanks guys! I was trying with SDK 31, will try it with SDK 32

@noahbaron
Copy link

noahbaron commented Nov 19, 2022 via email

@mdivya-symplr
Copy link

@AEiosApp Did it worked with sdk 32?
Mine is also sdk 32. Beacons are not detecting in Android 12/13 devices when we ask user to allow location permission with default android popup along with near by devices permission. Strange thing is if we install app and before opening it if we go to settings and give permission to location manually and opening the app as usual like allowing permission for near by devices and all then beacons are getting detected. Help would be appreciated. Thank You

@mdivya-symplr
Copy link

Recently, What i have observed is beacons are getting scanned only when we allow permission for PRECISE location.
If we give permission for APPROXIMATE location. beacons are not detected in Android 12/13.
Is it same for you @noahbaron

That’s strange, I built an app that targets SDK 32 and this plugin works fine, scans for iBeacons no problem. It requires manually adding entries to AndroidManifest.xml: Here’s a link to the entire file: https://github.com/baronbrew/Tilt-Hydrometer-Framework7/blob/master/platforms/android/app/src/main/AndroidManifest.xml

On Sat, Nov 19, 2022 at 8:04 AM AEiosApp @.> wrote: @Radik24 https://github.com/Radik24 nope, I checked all related issues posts on the github of android-beacon-library, but look like they don't have any solution yet for Android 12 — Reply to this email directly, view it on GitHub <#474 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAQ3FBMPO4KQ7NYKKZ5J4VTWJD27XANCNFSM6AAAAAARIW7PLI . You are receiving this because you are subscribed to this thread.Message ID: @.>

@steliosm
Copy link

steliosm commented Dec 6, 2022

Anyone manage to get this working?
Tried SDK 30, 31 & 32, added the permissions in the Manifest file but it never worked on an Android 12 phone.
@noahbaron what is your cordova environment?

@noahbaron
Copy link

noahbaron commented Dec 6, 2022 via email

@steliosm
Copy link

steliosm commented Dec 6, 2022 via email

@noahbaron
Copy link

noahbaron commented Dec 6, 2022 via email

@steliosm
Copy link

steliosm commented Dec 7, 2022 via email

@RN-programmer
Copy link

RN-programmer commented Apr 19, 2023

@noahbaron : I tried with the below combination. My cordova android app is not detecting any beacons.

implementation 'org.altbeacon:android-beacon-library:2.19.5-beta9' or higher.

cordova 11.0.0
android 10.1.2
SDK 32

I really appreciate if anyone is having a solution for this ibeacon cordova plugin.

@kenjan1974
Copy link

kenjan1974 commented Oct 3, 2023

If your Android 12/13 phone cannot scan beacon devices, try to manually enable the [nearby devices] permission.

[Samsung S21, Android 13]

  • open [Settings/Location]
  • click [App permissions]
  • click [Your APP]
  • Slide to the bottom of the screen
  • click [See all APP permissions]
  • allow [Nearby devices] permission

[Redmi]

  • Setting / Application Setting
  • click [Application Management]
  • click [permission Icon]
  • click [Application Permission Management]
  • click [Nearby devices]
  • click [Your APP]
  • allow [Nearby devices] permission

Or explicitly request user approval in your app before you can look for Bluetooth devices.
https://developer.android.com/guide/topics/connectivity/bluetooth/permissions

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

7 participants