Davy
Davy

Reputation: 125

OneSignal Push Notifications to redirect to specific app page

Does anybody knows how to direct to a specific app page using OneSignal Push Notification API ?

Upvotes: 2

Views: 3082

Answers (1)

Gdeglin
Gdeglin

Reputation: 12618

To direct users to a specific page, you can use the Additional Data field to add as many key value pairs as you wish. For example, you could add "product_id"="12345".

Next, OneSignal provides a callback function where you can add custom code to receive these key-value pairs when a user clicks a notification. In this function, you can direct the user to the in-app page of your choice.

Upvotes: 3

Related Questions