jbeuckm / TiBeacons

iBeacon advertising and scanning in a Titanium module
Other
135 stars 57 forks source link

Unable to receive notifications when application is swiped off background #12

Closed SumodhNair closed 10 years ago

SumodhNair commented 10 years ago

Hi, First of all thanks for creating such an awesome library to work with beacons.Can you tell me of any way where the application can restart itself in the background once a user swipes it off from the background,I need to keep the application working. Thanks :)

jbeuckm commented 10 years ago

I have been wrestling with this and it seems that one would have to modify the App Delegate in order to have iOS invoke the app on region status events: http://stackoverflow.com/a/22515773/693279

I reported the issue here: https://jira.appcelerator.org/browse/TC-4463

jbeuckm commented 10 years ago

UPDATE: I made a kludge that gets events working when the app isn't running. Please help me test ver0.9!

jamessugrue commented 10 years ago

I will! Will all events work in the background now?

jbeuckm commented 10 years ago

Call startMonitoringForRegion() with your region uuid. Then iOS will start your app when it sees a beacon and deliver the "enteredRegion" event. Your app will run for a short amount of time that you can use to begin ranging beacons, schedule a local notification, hit a server, whatever you want to do...