Manage Users
Create, update, & manage user profiles and communication channels using Flutter SDK methods.
How SuprSend identifies a user
SuprSend identifies users with immutable 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.
Identify user and set Push token
Create / Identify a new user
You can identify a user via suprsend.identify()
method. 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.
When you call this method, we internally create an event called $user_login
. You can use this event to trigger workflow on user login.
Parameter | 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
As soon as the user logs out, call suprsend.reset()
method to clear data attributed to a user. This allows you to handle multiple user logins on a single device and keep their data isolated from each other.
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.
Mandatory to call reset on logout:
Don’t forget to call reset on user logout. If not called, users’ distinct_id will not reset and multiple tokens and channels will get added to the distinct_id who logged in first on the device.
Set communication channels
Mobile Push tokens automatically gets updated in user profile on suprsend.identify()
call. All you have to do is to integrate push notification service in your application to start sending mobile push notification. To set other communication channels, use below methods.
Add User Channels
Add User Channels
Add user channels on signup, or whenever a user updates their communication channels in the application flow.
Android Push token will automatically be set at the time of user login. All you have to do is to integrate the push notification service in your application. Here’s the Android Push Integration guide.
Country Code Mandatory:
Make sure you are sending the country code when you are calling communication methods for SMS and Whatsapp.
Remove User Channels
Remove User Channels
Set user properties
You can sync other user properties in SuprSend and use it to pass dynamic content in template or add in workflow conditions.
Set
Set
Set is used to add property. Set is upsert function and will override existing values corresponding to a key.
Property key can’t start with $
or ss_
, as this is reserved for our internal events and property names.
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. |
Unset
Unset
This will delete property key
Append
Append
This method will append a value to an array
Remove
Remove
Removes property value but doesn’t unset property key. If you want to remove property key use unset method.
Set Once
Set Once
Works just like user.set
, except it will not overwrite existing property values. This is useful for properties like First login date
Increment
Increment
Increase or decrease integer values on consecutive action, like login count. To reduce a property, provide a negative number for the value.