Hello guys, i am developing an Ionic 2 app with the IBeacon plugin. In my View/Class i am searching for beacons and i am listening for the ibeacon events (i subscribed to it) to get all discovered beacons and with ngFor i print out all discovered beacons on the view.
My Problem here is that the View is not automatically refreshing its content. The View only refresh its content when I press another button or when i interact with the view.
How can I solve this problem?
Many thanks in advance!
Are you updating the scope variable in didRangeBeaconsInRegion() ?
Also I have a question too. I am working on the same app as you but I can’t discover my beacons, I am getting empty beacons array, can you please help me? See the screenshot
@MuzammilVerisiani: I had the same problem at the beginning. The Problem here is Android 6. After the Installation of the app there should be a permission request for the location, but the request was skipped by the plugin. You have to set the location-permission for the app manually in the settings of your device (settings -> apps). Then I think it should work.
@bengtler@MuzammilVerisiani :
My code currently looks like this: this.platform.ready().then(() => { let delegate = this.beaconService.getDelegate(); delegate.didRangeBeaconsInRegion().subscribe( (data) => { for(var i = 0; i < data.beacons.length; i++){ //this.beacons.push(data.beacons[i]); this.beacondata.list.push(data.beacons[i]) } }, (error) => { alert(error) } ) })
I will give it a try with the changeDectorRef.
But if you have other suggestions after seeing my code please tell me
Thanks