Titanium JIRA Archive
Appcelerator Community (AC)

[AC-1407] Bluetooth LE state restoration callbacks are blocked in Titanium

GitHub Issuen/a
TypeBug
Priorityn/a
StatusClosed
ResolutionCannot Reproduce
Resolution Date2014-06-26T21:51:29.000+0000
Affected Version/sn/a
Fix Version/sn/a
ComponentsTitanium SDK & CLI
Labelsble, bluetooth, ibeacon, ios
ReporterJohn V Pataki
AssigneeMauro Parra-Miranda
Created2014-06-19T23:16:28.000+0000
Updated2016-03-08T07:37:49.000+0000

Description

The following 2 callbacks never get called in Titanium when adding handling for the callback in a module. - (void)centralManager:(CBCentralManager *)central willRestoreState:(NSDictionary *)dict - (void)peripheralManager:(CBPeripheralManager *)peripheral willRestoreState:(NSDictionary *)dict The code for handling the callbacks works as expected in a native app. The same code can be inserted into Titanium module and tested in a Titanium app and you will notice that the the app does restore itself to the background however the callback handlers never fire. The callbacks are supposed to be called only when the app was previously in the background, then was killed off by iOS, and then some bluetooth activity for the app comes in. Similarly, the situation occurs for the following iBeacon related callbacks when the app has been killed off. - (void)locationManager:(CLLocationManager *)manager didDetermineState:(CLRegionState)state forRegion:(CLRegion *)region - (void)locationManager:(CLLocationManager *)manager didEnterRegion:(CLRegion *)region - (void)locationManager:(CLLocationManager *)manager didExitRegion:(CLRegion *)region The above iBeacon related functions are being called under normal circumstances, just not when the app was killed off as they are in a native app.

Comments

  1. Gary Paul Smith 2014-06-20

    Monitoring your environment while your App is not running is very important, even more so than ranging, I cannot stress how HUGE a problem this is and it should be fixed as quickly as possible. This means that the platform currently cannot support any real world iBeacon solutions in its current state. If you think about developing Retail App's (use cases) then this bug closers the door on developing any solution's, in this area. Monitoring is more important than ranging as this is the feature which makes your App context aware to its surroundings, this is the entry point. This is the feature that allows you to tell your user or backend that the user has entered a given context without the user having to take there telephone out of there pocket Many of our users do not have the app running in the background or foreground, to save battery power. On a Native Objective-C App this works like a dream This was one of the biggest feature of iOS 7 and is an even bigger feature of iOS8 (Internet of things - connected devices) being aware of the things in your environment. So Appcelerator you need to fix this soon.
  2. Mauro Parra-Miranda 2014-06-20

    Hello John, in order to move this Platform, do you have any small testcase that shows this issue? Thanks in advance! Best, Mauro
  3. John V Pataki 2014-06-23

    Mauro, During the effort to provide you the test case example as we discussed offline for this issue, we retooled our native example and module test case code from earlier discussions we had with Appcelerator on this topic using a different approach that was made more obvious to us since iOS7.1 was released. This different approach appears so far to result in Titanium not blocking callback handlers. We are still testing this different approach yet we are optimistic this will mean this issue can be closed and we will release updates to our modules if it all works as expected. Thanks, John
  4. Mauro Parra-Miranda 2014-06-23

    Hello John! Glad to read this. Please let us know how it goes! Best, Mauro
  5. John V Pataki 2014-06-26

    Mauro, We completed our testing on all of our modules that were previously affected by the issue that caused us to open this Jira ticket. The corner case where BLE / iBeacon callbacks from iOS can restart an app into the background that was previously killed off by iOS not responding as expected is now solved through our improvements to the modules themselves. We have submitted the updated modules to Appcelerator for approval to the Marketplace. Version 1.2.5 of each the [BLE iOS](https://marketplace.appcelerator.com/apps/3834) , [BLE Android](https://marketplace.appcelerator.com/apps/6611) , and [Beacons for iOS & Android](https://marketplace.appcelerator.com/apps/7619) modules will include the improvements. You can close this issue. Thanks, John
  6. Andrey Pervushin 2014-07-25

    Can you give info on, how you managed to fix this bug.

JSON Source