[AC-1407] Bluetooth LE state restoration callbacks are blocked in Titanium
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | n/a |
Status | Closed |
Resolution | Cannot Reproduce |
Resolution Date | 2014-06-26T21:51:29.000+0000 |
Affected Version/s | n/a |
Fix Version/s | n/a |
Components | Titanium SDK & CLI |
Labels | ble, bluetooth, ibeacon, ios |
Reporter | John V Pataki |
Assignee | Mauro Parra-Miranda |
Created | 2014-06-19T23:16:28.000+0000 |
Updated | 2016-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.
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.
Hello John, in order to move this Platform, do you have any small testcase that shows this issue? Thanks in advance! Best, Mauro
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
Hello John! Glad to read this. Please let us know how it goes! Best, Mauro
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
Can you give info on, how you managed to fix this bug.