Comment on page
Set User Id
Once your user is logged in and you can send us a userId, please do it otherwise the purchase will be tied to the device and your user won't be able to enjoy from another device. Setting it will allow you to tie a purchase to a user to use it on other devices.
This ID will be passed to the Webhook so that your backend can identify the user and unlock the access.
If our backend made a migration of user purchases and notified your backend, we will set the refresh variable in the callback to true.
Swift
Objective-C
Kotlin
Java
React Native
Cordova
Flutter
Unity
Purchasely.userLogin(with: "123456789")
[Purchasely userLoginWith:@"123456789"];
Purchasely.userLogin("123456789") { refresh ->
if (refresh) {
//you can call your backend to refresh user information
}
}
Purchasely.userLogin("123456789", refresh -> {
if(refresh) {
//you can call your backend to refresh user information
}
return null;
});
Purchasely.userLogin('123456789').then((refresh) => {
if (refresh) {
//call your backend to refresh user information
}
});
Purchasely.userLogin('user_id', refresh => {
if(refresh) {
// You can call your back-end to refresh user information
}
});
Purchasely.userLogin('123456789').then((refresh) => {
if (refresh) {
//call your backend to refresh user information
}
});
private PurchaselyRuntime.Purchasely _purchasely;
_purchasely.UserLogin("userId", OnUserLoginCompleted);
To remove the user (logged out) you can perform a :
Swift
Objective-C
Kotlin
Java
React Native
Cordova
Flutter
Unity
Purchasely.userLogout()
[Purchasely userLogout];
Purchasely.userLogout()
Purchasely.userLogout();
Purchasely.userLogout();
Purchasely.userLogout()
Purchasely.userLogout();
private PurchaselyRuntime.Purchasely _purchasely;
_purchasely.UserLogout();
Last modified 3mo ago