gpt4 book ai didi

ios - 应用程序 didFinishLaunchingWithOption : detecting if app was launched after entering iBeacon region

转载 作者:行者123 更新时间:2023-11-29 10:23:35 24 4
gpt4 key购买 nike

未运行的应用在进入 iBeacon 区域时由 iOS 启动。第一个调用的方法是- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions。由于启动原因可能不同,我希望能够从启动选项中检测到启动是否是由于进入特定(我正在监视的)iBeacon 区域。这可能吗?

我从 ApplicationDelegate 文档中找到了以下内容,但我不认为这是正确的,因为它没有直接提及 iBeacons。

UIApplicationLaunchOptionsBluetoothCentralsKey The presence of this key indicates that the app previously had one or more CBCentralManager objects and was relaunched by the Bluetooth system to continue actions associated with those objects. The value of this key is an NSArray object containing one or more NSString objects.

Each string in the array represents the restoration identifier for a central manager object. This is the same string you assigned to the CBCentralManagerOptionRestoreIdentifierKey key when you initialized the central manager object previously. The system provides the restoration identifiers only for central managers that had active or pending peripheral connections or were scanning for peripherals.

Available in iOS 7.0 and later.

最佳答案

要查看信标检测是否启动了您的应用,请检查 UIApplicationLaunchOptionsLocationKey。这不会告诉您哪个 CLBeaconRegion 条目启动了您的应用程序。为此,您必须等待后续的 didEnterRegion 并检查传递的值。

关于ios - 应用程序 didFinishLaunchingWithOption : detecting if app was launched after entering iBeacon region,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33563266/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com