How to bring application to foreground in ios?
Asked Answered
K

2

6

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

Kiarakibble answered 8/4, 2014 at 7:23 Comment(1)
all you can with public API is post local notificationDoctor
C
20

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.

Cheslie answered 8/4, 2014 at 7:29 Comment(4)
This is correct. Any dfoyubters can see my failed attempt to force an app to the foreground here:https://mcmap.net/q/456123/-can-i-launch-an-app-in-foreground-when-i-enter-an-ibeacon-range. It is worthy of note that Android does allow this.Rachitis
Thanks @Khawar Ali for you help. Done the same thing you mentioned.Kiarakibble
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 foregroudGotham
@Shakell Ahmed do you have an idea how to deal with it?Vanettavang
R
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.

Rendition answered 15/2, 2019 at 11:49 Comment(1)
Okay, then how to do something like whatsApp. How to show callkit notiifcaton and screen at the same time?Stuckey

© 2022 - 2024 — McMap. All rights reserved.