IBeacon PlugIn error


#1

Hello,
i am building an App using the IBeacon PlugIn. But when i’m trying to use it in my code I get an error : 'cordova is not defined ’ . I have checked the ‘cordova.js’ file and is not missing.
Here is a sample of code, for example when i type let delegate = IBeacon.Delegate(); i get the error.

 import { Component } from '@angular/core';
import { IBeacon } from 'ionic-native';
@Component({
  selector: 'page-home',
  templateUrl: 'home.html'
})

export class HomePage {
  items = Beacons;
}
IBeacon.requestAlwaysAuthorization();
let delegate = IBeacon.Delegate();

#2

You cannot test it on browser.


#3

Same here. i got the same error and i have couldn’t resolve it.

Please help.


#4

I have it working and I posted my code. Hope it helps you.


#5

Thanks. Your code was very helpful to me. But when i try copying the code in to my project and run on android mi code does not request for authorization and i have to give permission to the app manually. How can i solve this?.