Monday 9 November 2020

Using Firebase APNS notifications to link out to a url

I have been using Firebase to send simple push notifications to both iOS and Android devices.

Now I want to make the notifications link out to urls, so that when the user clicks the notification, they go to a url.

It looks from the Firebase documentation like I can assign a url to the click_action key to make that url into the destination on android devices. So, for example, as I am setting up an array of values in my PHP script, I have this line:

$data['message']['android']['notification']['click_action'] = $url;

I am having trouble finding information on which key to use for Apple devices. An old piece of documentation I dug up suggests that I use urlFormatString, but I get the impression that this is an old key that is only useful for Safari notifications in older versions of MacOS -- assuming I even understand the documentation correctly.

Is there a newer key that I can use to allow clicking of links in modern APNS notifications?



from Using Firebase APNS notifications to link out to a url

No comments:

Post a Comment