@luckyluke2012 wrote:
Hey guys,
I am trying to build my first app with ionic and angular. In this app I want to use an ibeacon. My problem is now, that I can't get any information from the ibeacon.
I tried this here as discribed: ibeacon ngCordova,
also this: support ibeacons in your ionic framework ,but I'm still not able to get it to run.
I even reinstalled the ibeacon plugin from github and checked the permissons for bluetooth in the android xml file.Here is my Code:
angular.module('meineapp.datactrl', ['btford.socket-io','angular-md5','ionic','ngCordova']) .controller('DataCtrl', function($rootScope,$scope,socket,md5,$ionicPlatform,$ionicPopup,$ionicLoading,$cordovaGeolocation,$cordovaBeacon){ $scope.beacon = {}; $ionicPlatform.ready(function () { //Beacon var identifier = "Beacon"; var uuid = "f0018b9b-7509-4c31-a905-1a27d39c003c"; var major = 23075; var minor = 20481; var notifyEntryStateOnDisplay = true; $scope.startRangingBeaconsInRegion = function() { $cordovaBeacon.startRangingBeaconsInRegion($cordovaBeacon.createBeaconRegion( identifier, uuid, major, minor, notifyEntryStateOnDisplay) ); }; $rootScope.$on("$cordovaBeacon:didRangeBeaconsInRegion", function (ev, pluginResult) { $scope.beacon.proximity = pluginResult.beacons[0].proximity; $scope.$apply(); }); });});
I hope somebody can tell me, what I'm doing wrong.
Posts: 1
Participants: 1