Open app with iBeacon

前端 未结 2 1515
时光说笑
时光说笑 2021-01-03 13:57

I\'m so excited about the new release of iOs 7.1 with big changes for iBeacon, which is stated in here: http://beekn.net/2014/03/apple-ios-7-1-launches-major-ibeacon-improve

2条回答
  •  走了就别回头了
    2021-01-03 14:25

    In short yes. I've implemented this in an app and upon entering the range of the beacon the call is made to:

    - (void)locationManager:(CLLocationManager *)manager didEnterRegion:(CLRegion *)region;
    

    At that point my app is in the background. If it's been terminated re-opened but stays in the background. The class that I have set to be the CLLocationManager delegate receives the callback to the above method and, in my case, posts a local notification. However you could also trigger opening the app directly.

    There's a great little example app on the store called Hide My iPhone by John Yorke. He's opened sourced the code here and it shows how to set up and respond to beacons in an app.

    I also used the guide from Apple here to learn more.

提交回复
热议问题