Push Notifications
Marketing Cloud Personalization supports Push Notification campaigns for Android apps using Firebase Cloud Messaging.
If you'd like to use Personalization to send push notifications to your app via Firebase Cloud Messaging, you'll need to provide your Cloud Messaging API token. To obtain your Firebase Cloud Messaging API token and then add it to Personalization, do the following.
- Open your Firebase Cloud Messaging console for your app.
- Navigate to the project settings.
- Click the Cloud Messaging tab.
- Under Cloud Message API (Legacy), determine which Server Key you'd like to use and copy the associated Token.
- Log in to the Personalization UI and select the Dataset.
- From the left-hand menu, click Mobile > your app > Mobile Push Setup.
- Under Firebase Cloud Messaging, paste your Cloud Messaging API Token.
- Click Save.
To set up your app to use Firebase Cloud Messaging, do the following.
- Set up your app to use Firebase Cloud Messaging by following the instructions on Set up a Firebase Cloud Messaging client app on Android.
- To allow the collecting and sending of users' Firebase tokens to Personalization, your app must opt-in to Personalization push notification campaigns. For more information, see
usePushNotifications
. For example code, refer to theEvergage
class documentation. - Your app must call
setFirebaseToken
as described in thesetFirebaseToken
method documentation.
Additional Details
- You can only send push notifications to the most recent user. For more information, see
setUserId
. - Personalization automatically tracks clicks and opens from Firebase notifications under typical circumstances. However, when the app receives push notifications while foregrounded, if you decide to display custom content or launch an Activity with a
launchMode
other thanstandard
, you can ensure accurate campaign click tracking by following the instructions in the method documentation fortrackClickthrough(Intent)
andtrackClickthrough(Map)
.
- For information on testing your campaigns, see the Testing guide.
- To set up mobile data campaigns for your app, see Mobile Data Campaigns.