gpt4 book ai didi

ios - Ibeacon和建议的应用程序

转载 作者:行者123 更新时间:2023-12-01 18:52:59 25 4
gpt4 key购买 nike

如果可能,我需要使用IBeacons使用“建议的应用程序”功能

这是我的代码:

self.beaconRegion = [[CLBeaconRegion alloc] initWithProximityUUID:uuid major:1 minor:1 identifier:@“EstimoteSampleRegion”];

self.locationManager = [[CLLocationManager alloc] init];
self.locationManager.delegate = self;

[self.locationManager startRangingBeaconsInRegion:self.beaconRegion];
[self.locationManager requestAlwaysAuthorization];
[self.locationManager startUpdatingLocation];

像didRangeBeacons一样,调用了背景方法,但是我的锁屏为空。

谢谢!

最佳答案

对于“建议的应用”功能,您需要使用startMonitoringForRegion而不是startRangingBeaconsInRegion

另外,似乎您正在后台进行操作([self.locationManager startUpdatingLocation]; +我假设您已启用的位置服务的后台模式),但“建议的应用程序”功能不需要此功能。这样会耗尽手机的电量(因为它会使应用程序保持清醒状态),而Apple通常会拒绝没有充分理由的应用程序(例如,导航应用程序增加了对信标的支持)。

关于ios - Ibeacon和建议的应用程序,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29752468/

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