Aliases
Add custom Aliases within OneSignal.
This doc covers setting custom aliases and should not be used without first setting External ID. See Users for details before continuing.
A custom alias is a key : value
string made up of an alias label (the key) and an alias ID (the value). The alias label can be thought of as a consistent and static keyword across all users, while the alias ID is a specific value to identify a user for that particular label. For example: facebook_id : 3453443
, google_id : 573489307569
, firebase_id : test3555
.
Custom aliases are meant to be used in conjunction with external ID and should not be used on their own without first setting an external ID. See our Users doc for more details.
Benefits of Aliases
- Identify users across different databases or platforms. Required for Integrations.
- Send transactional messages through our Create Notification REST API.
- Fetch, Update and Delete users through our API.
How to Set Aliases
To set custom aliases using the SDK follow these steps:
- Set the
external ID
with theOneSignal.login
method - Set the custom aliases with the
addAlias
oraddAliases
method - Call
OneSignal.logout
to remove theexternal ID
and custom aliases for the subscription.
To set a custom alias using our REST API, you can utilize the Create Alias endpoint
Updated 2 months ago