petermetz / cordova-plugin-ibeacon

An iBeacon plugin for Phonegap / Cordova 3.x and upwards. Supports both iOS and Android (contributions are welcome)
Apache License 2.0
728 stars 372 forks source link

LocationManager is undefined #443

Open caiusCitiriga opened 4 years ago

caiusCitiriga commented 4 years ago

Hello, I'm trying to use this plugin, but when I install it on an Ionic4 project and run the app on my android device I get this error:

Image 1

  1. Expected behavior and actual behavior. I expect to be able to build and test the plugin following the demo code on the Ionic plugins page

  2. Steps to reproduce the problem. Create a fresh Ionic4 application, install the plugin, implement the code, build and run. Once ran, the error will appear.

  3. cordova-android version 6.10.1

  4. cordova-ios version 6.10.1

  5. cordova-plugin-ibeacon version 3.7.0

  6. If running on a device, device model and os version. OnePlus 5T on android 10

ABRT29 commented 4 years ago

Hello,

Please follow this link. You will need to replace three files in \node_modules\@ionic-native\ibeacon:

index.js ngx/index.js __ivy_ngcc__/ngx/index.js

caiusCitiriga commented 4 years ago

Hey thank you @ABRT29! Not the best solution, but at least we've got a workaround for now... I cannot test this right now, but I'll surely do in the next few days, I'll keep you updated about this 😊

ABRT29 commented 4 years ago

Exactly, I use it since this morning tell me if it also works for you :)

Jusdon commented 4 years ago

Hey i have the same issue and it works fine except for the rangeBeaconsInRegion Function there i get no response

caiusCitiriga commented 4 years ago

Hey i have the same issue and it works fine except for the rangeBeaconsInRegion Function there i get no response

So you have been able to make it work with a fresh Ionic project? That's great! Can't wait to try!

Jusdon commented 4 years ago

Hey i have the same issue and it works fine except for the rangeBeaconsInRegion Function there i get no response

So you have been able to make it work with a fresh Ionic project? That's great! Can't wait to try!

Yes same Issue. It works the solution for you or you have the the issue with RangeBeacons in Region

mwyld commented 4 years ago

Same issue here, this fixed it for me too. Hopefully it'll be sorted soon! :)

Stefanic commented 4 years ago

I made a pull request for the Ionic Native wrapper of this library last week and it has already been released with version 5.28.0: https://github.com/ionic-team/ionic-native/pull/3505

Hope it helps you guys!