App state turn to active from background automatically

Hello, everybody.


I'd like to know one skill when developing an iPhone application.

What I really wanna do is that, 1) Installing app 2) Send silent push notification from web page to that app that is not shown to user 3) Automatically make active that application from background state.


In a word, without user interaction, can the app state could turn from background to foreground?

I'd googled much but couldn't find any valuable resources.


Hope to hear from you.

Regards

In a word, without user interaction, can the app state could turn from background to foreground?

No, that’s not currently possible. On iOS the user is always in charge of which app is at the front.

In general, if you’re in the background and you want to come to the front, the best approach is to post a local notification. If the notification has an action, the user can use that action to easily bring your app.

Share and Enjoy

Quinn "The Eskimo!"
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"

Hi, eskimo


Thank you for your reply.

When the app receives the silent push notification, then the

application:didReceiveRemoteNotification:fetchCompletionHandler:
method is called, I think.


Or

application:handleActionWithIdentifier:forRemoteNotification:completionHandler:method
is called.

Then in that method, how about fire a local notification with action to make the app to the front(of course, without user interaction). Is that possible?


Thanks.

Then in that method, how about fire a local notification with action to make the app to the front(of course, without user interaction). Is that possible?

Yes. It’s perfectly reasonable to post a local notification from your silent push notification handler. This can be necessary if, for example, your app has state that your push provider doesn’t have about what should generate UI.

The downside is that silent push notifications can be deferred (for power and budgetary reasons) whereas standard push notifications are always delivered promptly.

Finally, just to be clear, none of these notifications force your app to the front, they just give the user the opportunity to bring your app to the front easily.

Share and Enjoy

Quinn "The Eskimo!"
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"

Hi Eskimo,


I have a issue related with local push in background mode. My situation is here:

1. I use LocationManager for manage and update loaction and region for iBeacon.

2. When enter or exit region -> I will post a local notification message.

3. It work fine if app in background or in lock screen with condition is screen on.

4. It not work if creen is off.

(Note: It's work fine on iOS 8.4.1, this only happened on iOS 9 GM)


Do you have any idea on this? or we need to wait for iOS 9 official version?


Thanks,

Phuoc Phan

4. It not work if creen is off.

What do you mean by ‘doesn’t work’?

or we need to wait for iOS 9 official version?

It’s very unlikely that something like this would change between the GM seed and the GM.

Share and Enjoy

Quinn "The Eskimo!"
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"
App state turn to active from background automatically
 
 
Q