2016-09-06 3 views
8

私のアプリでは、CoreLocationでビーコン領域の監視を使用しています。 アプリは2つのproximityUUIDを地域(異なるIDを持つ)として に設定し、次のようにレンジングを開始します。 [IOSの8/IOSの9]iOS 10のビーコンのレンジング

#pragma mark - CLLocationManagerDelegate 

(void)locationManager:(CLLocationManager *)manager 
didEnterRegion:(CLRegion *)region { 
    [self.locationManager requestStateForRegion:(CLBeaconRegion *)region]; 
} 

- (void)locationManager:(CLLocationManager *)manager 
didExitRegion:(CLRegion *)region { 
    [self.locationManager stopRangingBeaconsInRegion:(CLBeaconRegion *)region]; 
} 

- (void)locationManager:(CLLocationManager *)manager 
didRangeBeacons:(NSArray *)beacons inRegion:(CLBeaconRegion *)region{ 
    for(CLBeacon* b in beacons){ 
     //output only previous beacon if it's before regionout to previous region 
     NSLog(@"%@",b); 
    } 
} 

- (void)locationManager:(CLLocationManager *)manager didFailWithError:(NSError *)error { 
    //error 
} 

- (void)locationManager:(CLLocationManager *)manager didDetermineState:(CLRegionState)state forRegion:(CLRegion *)region{ 
    if(state == CLRegionStateInside){ 
     if ([region isMemberOfClass:[CLBeaconRegion class]] && [CLLocationManager isRangingAvailable]){ 
      [self.locationManager startRangingBeaconsInRegion:(CLBeaconRegion *)region]; 
     } 
    } 
} 

これは、IOSの8とiOS 9で動作し、それはIOSの10

に動作しない

1.broadcast beacon1 

2.[app]didRangeBeacons (beacon1) 

3.stop beacon1 and broadcast beacon2 

4.[app]didRangeBeacons (beacon2) 

[IOSの10]

1.broadcast beacon1 

2.[app]didRangeBeacons (beacon1) 

3.stop beacon1 and broadcast beacon2 

4.[app]didRangeBeacons (**beacon1**) 

iOS 10のバグですか?

+2

iOS 10ではビーコンレンジングとはまったく異なると思われます。私は一時的に表示されたビーコンと非常に矛盾した結果を得ていますし、didRangeBeacons関数で再度範囲指定することはありません。 – davidethell

+0

お試しいただき、ありがとうございました!私は更新で解決されるのを待っています... –

+0

あなたはこの問題のレーダーをファイルしましたか? –

答えて

0

私はSwift 3でも同じ問題がありましたが、解決しました。

は(おそらく直接関連している)二つのものがあるように思われる:ビーコンの広告間隔は(約200ミリ秒に設定して、それが動作するはずですが高すぎる設定されることがありますiOS10ため

  • 両方とも9 & 10としてMacromorsのdantasticからアドバイスを受けました)

  • iOS 9.3.5を搭載したiPadでテストしましたが、展開ターゲットを9.3に変更する必要がありました。それは、iOS 9搭載のiPadで再び動作することを示していましたが、iOS 10デバイスでも解決しました。

関連する問題