如果区域没有主要区域,则区域监视在iOS中不起作用

前端之家收集整理的这篇文章主要介绍了如果区域没有主要区域,则区域监视在iOS中不起作用前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
在我的iOs应用程序中,我试图监视不同参数上的一些信标区域,如下所示:

>方法1 – 仅具有UUID和标识符的区域:

In above scenario am starting monitoring beacon region with following
code where only uuid and identifier given.

CLBeaconRegion *region = [[CLBeaconRegion alloc] initWithProximityUUID:convertedUuid identifier:strIdentifier];

Method 2 – Region With UUID,Major and Identifier :

In above scenario am starting monitoring beacon region with following
method where uuid,major and identifier value given

CLBeaconRegion  *region = [[CLBeaconRegion alloc] initWithProximityUUID:convertedUuid  major:[self.major intValue] identifier:strIdentifier];

Method 3 – Region with Major Minor and Identifier :

In above scenario am starting monitoring beacon region with following
method where all uuid,major,minor and identifier value given

CLBeaconRegion  *region = [[CLBeaconRegion alloc] initWithProximityUUID:convertedUuid  major:[self.major intValue] minor:[self.minor intValue] identifier:strIdentifier];

现在考虑到上述3种方法,我开始进行区域监测,具体如下:

[self.locationManager startMonitoringForRegion:region];

不幸的是,只有第3种方法才会调用beacons进入和退出委托.但是当我使用第一种或第二种方法时,我无法接收进入和退出区域代表.

注意:我没有立即运行所有方法.我一次只使用一种方法.

任何人都可以提供任何反馈或提供任何帮助为什么其他区域方法不起作用但只有第三种方法工作?

解决方法

确保没有其他信标具有相同的proximityUUID(方法1)或相同的proximityUUID和相同的major(方法2).当有另一个信标时,应用程序将不会获得退出事件,因为它仍然位于由proximityUUID / major定义的区域中.

猜你在找的iOS相关文章