-
Notifications
You must be signed in to change notification settings - Fork 57
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Apple reject app with backrground modes #37
Comments
@boardmain I think you don't need the background-modes in the tiapp.xml. If you'll get out the app (by pressing the homebutton or killing the app) while you where monitoring regions, iOS continues monitoring in background automatically. If iOS detects a new beacon in the background, the application will launch and you can get start beaconRanging for 10 seconds. More information / source : https://developer.apple.com/library/ios/documentation/UserExperience/Conceptual/LocationAwarenessPG/RegionMonitoring/RegionMonitoring.html. |
@jbeuckm I think it's necessary to update the README about scanning iBeacons when the application is not in foreground. The readme tells it's necessary to define the UIBackgroundModes in tiapp.xml, but Apple has another vision about that (see link above). What do you think? |
Hi can you please show a little example on how to scan iBeacons in background (ranging?) I'm trying on ios 9 and I cannot range in background thanks for all in advance |
First step, include permissions inside your tiapp.xml For example: |
Also, event listeners setup after the correct permissions have been set will still work even when the app has been sent to the background. Only transmitting won't work. It is not required to setup or register a background service in the usual titanium way. |
Hi, I'm still here, sorry.. I've coded this, in order to notify (app in background) when my iphone enters a region and , second, when it is "near" to beacon. Region listeners work well, also without UIBackgroundModes, Proximity listener (or ranging listener, I've tryed also this listener) does not work, also after setting the tiapp.xml correctly as RBAtkins0n suggests. Here's the code: var TiBeacons = require('org.beuckman.tibeacons'); TiBeacons.startMonitoringForRegion({ function notify(msg) { Furthermore: the title of the issue is "Apple reject app with backrground modes" and williamrijksen says that "you don't need the background-modes in the tiapp.xml", so what do I have to do? I'm working with 0.9.3 version of the module, do I have to update to 0.10.0 to work on iOS9? thanks for all your time, sincerely |
iOS 9 is working at present in my current project. Apple will reject you app when you submit it to the app store if you can't justify the benefit to the user for ranging. I've got it working on my project, Firstly, I'm using a branch version 0.11.0 for a number of reasons. Yours may work without the fixes in version 0.11.0, but just letting you know. See https://github.com/williamrijksen/TiBeacons You need background modes enabled to allow for region events and for ranging. This is how I managed to get it to range in the background, defined in my main js file: `// REGION EVENTS function exitRegion(e) { The enter and exit region events trigger the ranging functionality. |
ok, thanks I've tried your code, but in this way ranging is performed only for few seconds after the iphone enters the region. |
@wallanoo Continuous background ranging for beacons is only possible when you enable You have to explain to Apple why it's required from a functional perspective to range the beacons also in background-mode. When it's not required from a functional perspective, your app should be rejected by Apple. I hope it is clear now. |
Yes, @williamrijksen is right (and also the author of the branch I'm using). My project ranges constantly in the background when the beacon is in the region. You don't want to be ranging when outside the beacon, as it uses much more power. I use beaconranges instead of proximity events. Also, I ended up creating a background service that uses determinedRegionState to start ranging if the device in already inside a region (as the enter/exit region event won't fire if the device is already inside the region). If you are ranging and from the foreground and go to background, the ranging will stop, but can be triggered again by either entering/exiting an ibeacon region or by using an event listener in a dedicated background service, at least that's what I did. |
how do you manage determinedRegionState? the background service now works for me but only for about 2-3 minutes |
hi i tried to submit one apps with this background modes in the tiapp.xml
but apple rejected it beacouse it use bacground location and bluetooth modes..
how you made to make it approve?
The text was updated successfully, but these errors were encountered: