6

I am detecting for iBeacon in background. When my device comes in a particular region application should comes to foreground.

Shrinivas Kulkarni
  • 492
  • 2
  • 5
  • 17

2 Answers2

19

It cannot be done without user interaction. The only option is you can generate a push notification to tell the user to bring the application to foreground.

This is from the Apple documentation about this issue:

When the operating system delivers push notification (iOS or OS X) and the target application is not running in the foreground, it presents the notification (alert, icon badge number, sound). If there is a notification alert and the user taps or clicks the action button (or moves the action slider), the application launches and calls a method to pass in the local-notification object or remote-notification payload. If the application is running in the foreground when the notification is delivered, the application delegate receives a local or push notification.

rckoenes
  • 69,092
  • 8
  • 134
  • 166
Khawar Ali
  • 3,462
  • 4
  • 27
  • 55
  • 2
    This is correct. Any dfoyubters can see my failed attempt to force an app to the foreground here:http://stackoverflow.com/a/22230693/1461050. It is worthy of note that Android does allow this. – davidgyoung Apr 08 '14 at 11:52
  • Thanks @Khawar Ali for you help. Done the same thing you mentioned. – Shrinivas Kulkarni Apr 10 '14 at 07:50
  • 1
    Its is possible because when Whatsapp Call receive and app close its come to foreground AND WHEN app in backgroud and whatapp call receive app auto come to foregroud – Shakeel Ahmed Nov 05 '18 at 13:07
  • @Shakell Ahmed do you have an idea how to deal with it? – fobus May 15 '19 at 09:48
2

To answer to some comments about WhatsApp, with it, when you receive a classic vocal call, IOS use CallKit to display your call and wake up your phone, but it's not inside app. I try to make a video call with WhatsApp, and in this case, there is a notification. Press notification open app and answer to the call.

Conclusion : It's impossible to wake up app from background to foreground in IOS, but it's not really a problem because you can use notification to display what you want and get the user to your app after a touch on your notification. All of iPhone users are familiar with this kind of interaction, it's better to deal with it.

  • Okay, then how to do something like whatsApp. How to show callkit notiifcaton and screen at the same time? – Fasikaw Sep 09 '22 at 07:14