Understanding Push Tokens and what they are is a fundamental piece of understanding how we send Push Tokens here at Braze. A Push Token is an identifier that senders use to target specific devices with a push notification. If a device does not have a push token, there is no way to send push to it. This article covers the process through which a user gets assigned a push token, and how Braze sends Push messages to your users.
Push Tokens are generated by Push Service Providers. Braze connects with Push Service Providers Firebase Cloud Messaging Service (FCMs) for Android and Apple Push Notification Service (APNs) for iOS. Each device has one, unique token that is used for messaging. Tokens can expire or be updated.
Android and iOS deal with Push token registration in different ways:
- Android: Receives a token as soon as a user downloads and opens an application, automatically registering users for Push Notifications.
- iOS: Not automatically registered.
- iOS 12: If you have provisional authorization set up, you will be allowed to send notifications silently to the notification center of the device. These notifications may prompt users to decide to continue to receive notifications. Their push subscription state is dependent on the user’s response to this prompt.
- iOS 11 and Later & iOS 12 (without Provisional Authorization):
The native Push notification prompt appears for new users to an application. Users respond to this prompt by selecting allow or deny. Deny denies push token registration, therefore denying push notifications to your phone from that application. Allow registers and creates a new push token, then and there.
|Get a Push Token||Send a Push Token|
|Applications must register with a push provider in order to get a push token for a device.||Developers can then target the device using the push token generated by FCM/APNs.|
Two Ways to Check a User’s Push Registration State:
- User Profile: Individual user profiles can be accessed through the Braze dashboard by selecting User Search from the right sidebar. Here, you can look up user profiles by email address, phone number, or external user ID. Once in a user profile, under the Engagement tab, you can view a user’s push registration state.
- Rest API Export: Individual user profiles can be exported in the JSON format using the users/export/ segment or identifier endpoints by using Braze’s REST API. Braze will return a push tokens object, that contains push enablement information per device, as well as an additional
notifications_enabledparameter that will signify if a user blocked notifications from displaying (the previous Android SDK version does not have the
Push Token Management
Check out the chart below for actions that lead to push tokens changes or removal from user profiles.
|Push Error Occurs||Some common push errors that lead to token removal include
Check out our full list of common push errors.
|User Uninstalls||When a user uninstalls the application from a device, Braze will remove the user’s push token from the profile.|
What Does this Look Like on a Broader Scale?
When a user opens a new application, if push has been configured correctly, a call is made from the Braze SDK to the Push Providers. When that call is made, the Push Provider runs a check to see if everything is set up correctly. If so, a push token gets passed into your device. When that token arrives, the SDK communicates this to Braze. Once Braze has received the token from the Push Provider, we update or create a new user profile. These users are now considered Registered.
If we want to launch a campaign, we create a campaign in Braze that generates a push payload to send to the Push Provider. From there, the Provider delivers the Push Payload to the user’s device and the SDK passes the messaging state to Braze.
|Registration steps||Messaging steps|
|1. Customer (device) registers to push provider
2. Provider generates and delivers push token
3. Flush tokens in Braze
|1. Braze sends push payload to provider
2. Provider delivers the push payload to the device
3. SDK passes messaging stats to Braze
Frequently Asked Questions
What does the lifecycle of an opted-in push user look like upon deletion and then redownload of the app?
Suppose a user opts-in for push, receives some push messaging, and then later deletes the app; this will remove the push consent at the device level. From here, the first bounced push after the uninstall will result in that user being opted-out of future push messaging. After this, if a user were to reinstall the app but not launch it, Braze will be unable to send a push to the user because push tokens have not been re-granted for your app.
Additionally, if a user were to re-enable foreground push, it would require a session start to update this information in their user profile to begin receiving push messaging.