We need to build a push notification that redirects to a web link when you click it. Anyway, when I create a push notification from the content builder, I have an option to select an open behavior, so I choose "Go to Web URL" and enter the URL:
When I receive the message on my phone (one plus 6 if it matters) and click it, it redirects me to the app, and not to google.
How do I fix the redirection behavior of my push notification? thanks.
Best Answer
While Zak's answers isn't incorrect, it does require a bit more discovery once you click the links he provided.
To be specific to the original question, in the Android SDK you will need to provide an implementation of the
NotificationLaunchIntentProvider
during the initialization of the SDK. In this implementation, you can build out thePendingIntent
that will be used when the notification is clicked. For push messages containing OpenDirect URLs you can return something along the lines of:However, as a security best practice, I would suggest that you check the URL in the notification and make sure it is whitelisted for your application.
More details on using the
NotificationLaunchIntentProvider
and how to provide one during SDK initialization can be found here: https://salesforce-marketingcloud.github.io/MarketingCloudSDK-Android/notifications/customize-notifications.html