Android SDK Methods to create user and set their android push token and other communication channels for sending notifications.
distinct_id
. It’s best to map the same identifier in your DB with distinct_id
in SuprSend. Do not use identifiers that can be changed like email or phone number. You can view synced users by searching distinct_id
on Users page.
Create/Identify a new user
ssApi.identify()
method. Androidpush token is automatically set in user’s profile when this method is called.
Call this method as soon as you know the identity of user, that is after login authentication. If you don’t call this method, user will be identified using distinct_id (uuid) that SDK generates internally.We internally create an event called $user_login
. You can see this event on SuprSend workflows event list and you can configure a workflow on it.Parameters | Type | Description |
---|---|---|
distinct_id | int, bigint, string, UUID | mandatory Unique identifier for a user across devices or between multiple logins. |
Call reset to clear user data on log out
ssApi.reset()
method to clear data attributed to a user. This will generate a new random distinct_id
and clear all super properties. This allows you to handle multiple users on a single device.When you call this method, we internally create an event called $user_logout. You can see this event on SuprSend workflows event list and you can configure a workflow on it.Add User Channels
Remove User Channels
Set
Parameters | Type | Description |
---|---|---|
key | string | Mandatory This is property key that will be attached to user. Should not start with $ or ss_ |
value | any | Optional This will be value that will be attached to key property. |
JSONObject | object | Optional This is used in case of setting multiple user properties. |
$
or ss_
, as we have reserved these symbols for our internal events and property names.Set Once
ssApi.getUser().set
, except it will not overwrite existing property values. This is useful for properties like First login date.Increment
Append
Remove
Unset