Invoke safari on receive of Silent Push

On receive of silent push I was able to connect to server and post some data. However I want to know whether safari browser can be opened too? I tried adding code but nothing happened. Logically Apple introduced this feature so that users wont get disturbed and silently app can do what it needs, however I have a requirement to open a browser for specific silent push.


Any suggestion would help me to take decision.


Thanks,

Answered by junkpile in 17505022

No, you cannot call openURL from the background. (Well you can call it but it won't do anything.) I think the best you could do is post a local notification so the user is informed; then if they tap on that notification to launch your app into the foreground, you could call openURL to switch to Safari at that point.

Accepted Answer

No, you cannot call openURL from the background. (Well you can call it but it won't do anything.) I think the best you could do is post a local notification so the user is informed; then if they tap on that notification to launch your app into the foreground, you could call openURL to switch to Safari at that point.

thank you, I was in same understanding.

Hi @Manikandan, I'm trying to implement safari push using APNS. Can you please help me understand which event receives the silent push message? Should we have a service worker implementation? In any case which event please?

I recommend that you start a new thread for this. This thread is about launching Safari when a native app receives a push notification, which is kinda the opposite of what you want to do.

Tag your thread with Safari so that relevant folks see it.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

Invoke safari on receive of Silent Push
 
 
Q