My use case is that when the application running in background detects iBeacon then the application should come to foreground. Is there any way to do it.
Asked
Active
Viewed 922 times
2
-
1The user's use case is that they should not be interrupted by some background app suddenly becoming the foreground app while they are in the middle of doing something else. – rmaddy Apr 22 '14 at 06:00
-
2Isn't this the same question? http://stackoverflow.com/questions/22930259/how-to-bring-application-to-foreground-in-ios – GenieWanted Apr 22 '14 at 06:02
-
You can't bring your application to foreground without user interaction. But you can monitor the events using corebluetooth background modes. And if you want to notify any particular thing to user, you can post a UILocalNotification. – Midhun MP Apr 22 '14 at 06:12
1 Answers
0
According to the Apple Developer Forums iBeacons will only be broadcasted by to the app in the foreground. It probably has to do with the power saving characteristics of Core Bluetooth. Apple needs to modify all aspects of the Bluetooth advertisement to broadcast the beacons and this isn't available when the app is in the background according to the docs. https://developer.apple.com/library/ios/documentation/NetworkingInternetWeb/Conceptual/CoreBluetooth_concepts/CoreBluetoothBackgroundProcessingForIOSApps/PerformingTasksWhileYourAppIsInTheBackground.html

Nipun Bilala
- 11
-
1Read that document carefully. Because You can do that by setting background task mode. Check the "Core Bluetooth Background Execution Modes" portion on that document for more info. – Midhun MP Apr 22 '14 at 06:09
-
@MidhunMP I have tried setting the flag for background task mode but its not working for me. – Shrinivas Kulkarni Apr 22 '14 at 06:37