使用iBeacon打开应用程序 [英] Open app with iBeacon

查看:243
本文介绍了使用iBeacon打开应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我对iO 7.1的新版本感到非常兴奋,iBeacon发生了重大变化,详见下文: http://beekn.net/2014/03/apple-ios-7-1-launches-major-ibeacon-improvement/

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-improvement/

在这里: http://beekn.net/2014/03/prisoners-dilemma-ios-7-1-challenges-ibeacon-developers/

根据主题,他们说


在iOS 7.0中你可以关闭应用程序,它会停止发送
你的消息。现在,该应用甚至不需要打开或在
背景下工作。

In iOS 7.0 you could just close off the app and it would stop sending you messages. Now, the app doesn’t even need to be open or in the background to work.

就我而言知道,当应用程序关闭(不在后台)或发送任何本地通知时,您无法执行任何操作。

As far as I know, you couldn't do anything when an app is closed (not in the background) nor sending any local notification.

那么如果iOs 7.1设备进入iBeacon区域怎么知道呢?
如果您可以在关闭的应用程序进入iBeacon区域时捕获,您可以将其唤醒(打开它)吗?

So how do you know that if an iOs 7.1 device has enter an iBeacon region? And if you can catch when a closed app enter an iBeacon region, can you wake it up(open it)?

推荐答案

简而言之。
我已经在应用程序中实现了这一点,并且在进入信标范围时,调用是:

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;

此时我的应用程序在后台。如果它已被终止重新打开但仍留在后台。我设置为CLLocationManager委托的类接收上述方法的回调,在我的情况下,发布本地通知。
但是你也可以直接触发打开应用程序。

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.

商店里有一个很棒的小例子应用程序叫做John Yorke的Hide My iPhone。他已经开放了代码这里,它展示了如何在应用程序中设置和响应信标。

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.

我还使用了Apple的指南此处了解详情。

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

这篇关于使用iBeacon打开应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆