External User ID (legacy)
This is a deprecated page!
If youβve found yourself on this page, please check out the following documentation pages:
What was deprecated?
The setExternalUserId
method will be deprecated in version 5+ of our SDKs.
Instead, the External User ID will now be called External ID and will be used as the default alias for the new OneSignal.login
method.
See the User Model Migration Guide for more details.
setExternalUserId
Method
The OneSignal SDK setExternalUserId
method should be called when the user logs into the app/site and within the callback of the setEmail
and setSMSNumber
methods to link the records together.
If you have a backend server, we strongly recommend using Identity Verification with your users. Your backend can generate an identifier authentication token and send it to your site.
Disassociating the External User Id
External User Ids can be disassociated from the current deviceβs subscription_id
record using the OneSignal SDK removeExternalUserId
method.
removeExternalUserId
Method
It is recommended to call this method when the user logs out of your app.