Push notifications can be sent with "extra" data to further customize where the user is directed or what happens when the notification is engaged upon.
For instance, perhaps you would like to direct a user to a certain in-app page. Or, perhaps you want to send a user to an external URL.
For APNs, you will need to make changes to your AppDelegate.m file to tell your application to act upon push notification "extra" data. In particular, you will be using the didReceiveRemoteNotification method to re-direct the user based on the extra data.
In this example, we will re-direct the user to the web if a "u" key/pair is passed along with your notification.
For iOS 9 and earlier:
For iOS 10 support, add:
The extra data can be passed through both the Web Dashboard and via our APIs. The picture below shows where to configure your push in the Web Dashboard UI to pass the extra data:
More information on the
didReceiveRemoteNotification method and other
UIApplicationDelegate protocols can be found here.