Start advertising device as an iBeacon (iOS only) ... If i use this below code to make my phone act as a Ibeacon then can i send any information also meaning can I broadcast any data packets with some information . if yes , can any one please advice how ?? thanks !!!
Start advertising device as an iBeacon (iOS only)
var uuid = 'DA5336AE-2042-453A-A57F-F80DD34DFCD9';
var identifier = 'advertisedBeacon';
var minor = 2000;
var major = 5;
var beaconRegion = new cordova.plugins.locationManager.BeaconRegion(identifier, uuid, major, minor);
// The Delegate is optional
var delegate = new cordova.plugins.locationManager.Delegate();
// Event when advertising starts (there may be a short delay after the request)
// The property 'region' provides details of the broadcasting Beacon
delegate.peripheralManagerDidStartAdvertising = function(pluginResult) {
console.log('peripheralManagerDidStartAdvertising: '+ JSON.stringify(pluginResult.region));
};
// Event when bluetooth transmission state changes
// If 'state' is not set to BluetoothManagerStatePoweredOn when advertising cannot start
delegate.peripheralManagerDidUpdateState = function(pluginResult) {
console.log('peripheralManagerDidUpdateState: '+ pluginResult.state);
};
Start advertising device as an iBeacon (iOS only) ... If i use this below code to make my phone act as a Ibeacon then can i send any information also meaning can I broadcast any data packets with some information . if yes , can any one please advice how ?? thanks !!!
Start advertising device as an iBeacon (iOS only)
var uuid = 'DA5336AE-2042-453A-A57F-F80DD34DFCD9'; var identifier = 'advertisedBeacon'; var minor = 2000; var major = 5; var beaconRegion = new cordova.plugins.locationManager.BeaconRegion(identifier, uuid, major, minor);
// The Delegate is optional var delegate = new cordova.plugins.locationManager.Delegate();
// Event when advertising starts (there may be a short delay after the request) // The property 'region' provides details of the broadcasting Beacon delegate.peripheralManagerDidStartAdvertising = function(pluginResult) { console.log('peripheralManagerDidStartAdvertising: '+ JSON.stringify(pluginResult.region)); }; // Event when bluetooth transmission state changes // If 'state' is not set to BluetoothManagerStatePoweredOn when advertising cannot start delegate.peripheralManagerDidUpdateState = function(pluginResult) { console.log('peripheralManagerDidUpdateState: '+ pluginResult.state); };
cordova.plugins.locationManager.setDelegate(delegate);
// Verify the platform supports transmitting as a beacon cordova.plugins.locationManager.isAdvertisingAvailable() .then(function(isSupported){