0

Can I launch app on push received, without tapping on push notification ?

Example case for such behaviour : show incoming call screen for voip app when app is in background.

As I know it's not possible with APNs push notifications, but in iOS 8, Apple introduced PushKit framework with Voip push type, and as I understand, I can have my desired behaviour with them.

  • No you can't. No such function to do so. – Raptor Jan 06 '16 at 09:50
  • 2
    I haven't read about PushKit, but from a user's perspective it would be **_very_** annoying if an app could launch itself like that, without user interaction. I really hope there is no answer to your question. – Nicolas Miari Jan 06 '16 at 09:51
  • 1
    @NicolasMiari I can have such behaviour on Android and all Android Voip apps do so, and I think its comfortable to see call screen when you have incoming voip call (as you see call screen on regular call). – Yulian Baranetskyy Jan 06 '16 at 09:54

3 Answers3

1

No, this is not allowed at all nor is it likely to be a feature that Apple would introduce.

Max Woolf
  • 3,988
  • 1
  • 26
  • 39
  • Please explain me [link](https://developer.apple.com/library/ios/documentation/Performance/Conceptual/EnergyGuide-iOS/OptimizeVoIP.html) >There are many advantages to using PushKit to receive VoIP pushes: >Unlike standard push notifications, which the user must respond to before >your app can perform an action, VoIP pushes go straight to your app for >processing. >Your app is given runtime to process a push, even if your app is operating >in the background. – Yulian Baranetskyy Jan 06 '16 at 10:00
  • That's only available for VoIP applications not for other apps. – Max Woolf Jan 06 '16 at 10:02
1

You can only receive payload of notification on which user tapped or selected from the notification center.

But there is a way, using that you can process your every push notification. add key content-available with value 1 in to your aps dictionary.

so it will look like,

{
    "aps" : {
        "alert" : {
            "title" : "Game Request",
            "body" : "Bob wants to play poker",
        },
        "badge" : 5
        "content-available" : 1
    }
}

If iOS system detects pushNotification with this key having value 1, it will call application:didReceiveRemoteNotification:fetchCompletionHandler: of your appDelegate.

Hitendra Solanki
  • 4,871
  • 2
  • 22
  • 29
0

No, It will in all probability never be a feature. Even if you (assume) technically introduce it, apple will block your app now.

Pushkit is introduced only for receiving VoIP calls (obviously needed there). Thats it. For generic apps, it is not present.