简体   繁体   中英

App won't open on push notification, when it was in background (iOS7)

I have this issue with iOS7, where I have the following use case for my app:

  • Launch the app, put it in background (press the home button);
  • Lock the device
  • When a push is received, the lock screen wakes up and displays this:

有问题的情况

What happens is, if I slide on the notification, everything's cool. My app gets the applicationDidBecomeActive call and I can process the notification.

If I slide on the bottom of the screen, though, nothing happens. I land in the iOS home screen, and no ribbon appears. If I go to my application manually, I won't even get the notification.

The problem is that my app is a VoIP app, so whenever the user discards the push, I would like at least to be able to display a ribbon that encourages the user to answer the call.

I can push a local notification, but for that I need to be aware that the user unlocked the screen without going to my app.

Is this a documented use-case in Apple doc? I couldn't find any relevant pointer. Any help appreciated..

What you are describing is normal behavior of iOS, which you as a developer can not change.

When the user slide over a notification in the lock screen that app is started, if the user slides of the the unlock part of the lock screen the the user will just unlock the device and see the last screen the device was on when it was locked.

As far as I know, if your app is in background, a push notification will land @ the notifications center and that's it. So I would say it's a normal behaviour the scenario you have described.

Also, if the app is in foreground when you receive the notification, it will not be posted on the notifications center.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM