Reputation: 117
I'm running iOS8 beta 5 on an iPhone 4S and can't get iBeacon monitoring / ranging to work reliably. I initially get one call to didDetermineState telling me I'm out of the beacon region, but then I never get any more calls even if I'm obviously inside or outside the beacon region. On the initial call to didDetermineState, I don't get a call to didExitRegion, which seems wrong as well.
Has anyone experience this? I have granted Always authorization
Upvotes: 1
Views: 765
Reputation: 499
Did you try with the Airlocate sample code provided by Apple? https://developer.apple.com/library/ios/samplecode/airlocate/introduction/intro.html Try this, it should work although I tried it and even with that "proved" code I can't range or monitor anything. Further more I found this interesting web with theoretically all you need to take account in order to get to work with iBeacons in IOS 8: http://nevan.net/2014/09/core-location-manager-changes-in-ios-8/
But your problem I think it's because the format of your adverts isn't Apple one's. You have to modify the Company identifier code in order to set this 0x004C, which matches with the Apple's one. I had Nordic's Company Identifier:
+----------------------------------------------------+----------------- - - -
| Packet sniffer frame header |
+----+-------------+-------------------------+-------+
|info| Packet nbr. | Time stamp | Length| Packet data
+----+-------------+-------------------------+-------+----------------- - - -
| 01 | 0C 00 00 00 | 49 12 27 44 00 00 00 00 | 30 00 | 2F D6 BE 89 8E 40 24 4E A0 C3 8B 04 FF 02 01 04 1A FF **59 00** 02 15 01 12 23 34 45 56 67 78 89 9A AB BC CD DE EF F0 00 01 00 01 BB BA 88 BA 37 A5
+----+-------------+-------------------------+-------+----------------- - - -
And you need:
+----------------------------------------------------+----------------- - - -
| Packet sniffer frame header |
+----+-------------+-------------------------+-------+
|info| Packet nbr. | Time stamp | Length| Packet data
+----+-------------+-------------------------+-------+----------------- - - -
| 01 | 01 00 00 00 | ED 07 68 00 00 00 00 00 | 30 00 | 2F D6 BE 89 8E 40 24 E4 98 E6 3C 1B 5D 02 01 1A 1A FF **4C 00** 02 15 01 12 23 34 45 56 67 78 89 9A AB BC CD DE EF F0 00 00 00 00 C5 E8 19 24 3A A5
+----+-------------+-------------------------+-------+----------------- - - -
I have put between ** ** the hex numbers you should modify. Now it works perfect for me.
Regards.
Upvotes: 3