iBeacon not tracking beacons in –release mode in android

  android, ibeacon, ionic3, release, uuid

We are working with ionic3 and using iBeacons library for beacons scanning. It is working fine in –debug and –prod mode but not working in –release mode for Android. No proguard is used. Below is code snippet:

let beaconRegion = this.ibeacon.BeaconRegion(
          'deskBeacon',
          'XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX'
        );

        this.ibeacon.startRangingBeaconsInRegion(beaconRegion).then(
          result => {
            // console.log('startRangingBeaconsInRegion', JSON.stringify(result));
          },
          error => {
            console.log(
              'startRangingBeaconsInRegion error',
              JSON.stringify(error)
            );
          }
        );

As mentioned above, working fine for –debug and –prod but not for –release version in Android. iOS is working fine for all. Permissions are also added in AndroidManifest.xml

    <uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
    <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
    <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
    <uses-permission android:name="android.permission.BLUETOOTH" />
    <uses-permission android:name="android.permission.BLUETOOTH_ADMIN" />
    <uses-permission android:name="android.permission.ACCESS_BACKGROUND_LOCATION" />

What could be the issue? Thank you in advance.

Source: Android Questions

LEAVE A COMMENT