iOS Question BeaconParser - Issue on Discover iBeacons

Discussion in 'iOS Questions' started by Christian García S., May 4, 2017.

  1. Christian García S.

    Christian García S. Active Member Licensed User

    Hi everybody,

    I have an issue I hope you can help me, I just implemented ebeacon parser in B4A without issues, its works perfectly.

    now I want to implement in B4I and I have an issue, I received log with error:

    Application_Start
    Application_Active
    Error occurred on line: 88 (BeaconParser)
    Out of bounds. Index=0 Length=0
    Stack Trace: (
    CoreFoundation <redacted> + 152
    libobjc.A.dylib objc_exception_throw + 38
    CoreFoundation <redacted> + 0
    BLE Example -[B4IArray getByteFast:] + 238
    BLE Example -[b4i_beaconparser _parseeddystone::::] + 1112
    CoreFoundation <redacted> + 68
    CoreFoundation <redacted> + 300
    BLE Example +[B4I runDynamicMethod:method:throwErrorIfMissing:args:] + 1786
    BLE Example -[B4IShell runMethod:] + 574
    BLE Example -[B4IShell raiseEventImpl:method:args::] + 2212
    BLE Example -[B4IShellBI raiseEvent:event:params:] + 1442
    BLE Example +[B4IDebug delegate:::] + 52
    BLE Example -[b4i_beaconparser _parse:::] + 524
    BLE Example -[b4i_main _manager_devicefound::::] + 904
    CoreFoundation <redacted> + 68
    CoreFoundation <redacted> + 300
    BLE Example +[B4I runDynamicMethod:method:throwErrorIfMissing:args:] + 1786
    BLE Example -[B4IShell runMethod:] + 574
    BLE Example -[B4IShell raiseEventImpl:method:args::] + 2212
    BLE Example -[B4IShellBI raiseEvent:event:params:] + 1442
    BLE Example +[B4IObjectWrapper raiseEvent:::] + 220
    BLE Example -[BleDelegate centralManager:didDiscoverPeripheral:advertisementData:RSSI:] + 508
    CoreBluetooth <redacted> + 906
    CoreBluetooth <redacted> + 638
    CoreBluetooth <redacted> + 84
    CoreBluetooth <redacted> + 50
    libdispatch.dylib <redacted> + 10
    libdispatch.dylib <redacted> + 22
    libdispatch.dylib <redacted> + 854
    libdispatch.dylib <redacted> + 886
    libdispatch.dylib _dispatch_main_queue_callback_4CF + 596
    CoreFoundation <redacted> + 8
    CoreFoundation <redacted> + 848
    CoreFoundation CFRunLoopRunSpecific + 470
    CoreFoundation CFRunLoopRunInMode + 104
    GraphicsServices GSEventRunModal + 80
    UIKit UIApplicationMain + 150
    BLE Example main + 108
    libdyld.dylib <redacted> + 2
    )

    The ibeacon is a ibeacon not an eddystone, I have B4I version 3.60 and the BLE 2.0 thats includes this version, I used the same ibeacons that used in B4A.

    Later I tested uncommenting this lines:

    For Each key As Int In AdvertisingData.Keys
    Log($"${key}= ${bc.HexFromBytes(AdvertisingData.Get(key))}"$)
    Next

    And I get this:

    Cannot parse: kCBAdvDataServiceData

    Thanks a lot for your help.

    Christian
     
  2. Christian García S.

    Christian García S. Active Member Licensed User

    I see always the parser goes to section in Sub Parse:

    #else if B4I

    In this section in AdvertisingData.ContainsKey("kCBAdvDataServiceData") return true and execute this code:

    tx = ParseEddystone(beacon1, b, 2)

    I dont see code when is ibeacon, only in other section #if B4A.

    I hope with this I can help with something.

    Thanks,

    Christian
     
  3. Erel

    Erel Administrator Staff Member Licensed User

  4. Christian García S.

    Christian García S. Active Member Licensed User

    Thanks Erel for your response.

    Thats means I cant use ibeacons with IOS app or I cant use only with Beacon Parser ??

    I want use only for read major and minor, can I use with other functions like BLE https://www.b4x.com/android/forum/threads/discovering-ibeacon-devices-with-ble2-library.60151/

    I just downloaded LOCATE APP in Apple store, this app read beacons registering this UUID, why I can't do that with B4I ??

    I buyed new ibeacons I am disappointed I can not read, must I buy Eddystone for works with two apps Android and IOS in my APP ??

    Thanks a lot for your help

    Christian
     
  5. Christian García S.

    Christian García S. Active Member Licensed User

    Erel,

    I was read about iBeacons and I found, APPLE introduces new iBeacon CoreLocation APIs and disallow access to the raw advertisement body.

    http://stackoverflow.com/questions/...-to-get-all-of-proximityuuid-programmatically

    Are you think make new library (Beacons regions / CLBeaconRegion) for access to this information for works with beacons ?? The new features for this new library too is you can keep monitoring beacons in background, actual library beacon parser is not succesfull for changes en OS

    Or you can help me with some code in OBJC that I can use for work with my APP and works like in Android.

    Thanks for your help.
     
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice