-
public class PLYUserManager
-
-
Field Summary
Fields Modifier and Type Field Description public final static PLYUserManagerINSTANCE
-
Method Summary
-
-
Method Detail
-
loginUser
final Unit loginUser(String userId, Function1<Boolean, Unit> callback)
Logs in the user with the given userId.
If the SDK is not initialized, the user is already logged in with the same userId, or user identification is disabled by privacy dataProcessingPurposes, this function will do nothing and invoke the callback with
false.If the user was previously anonymous and has made purchases, a user transfer process will be initiated.
After a successful login (or if no action was needed), the function will clear any existing subscriptions from storage and fetch remote subscriptions if the user transitioned from anonymous to a known user.
- Parameters:
userId- The unique identifier for the user.callback- An optional callback that will be invoked withtrueif the login (and potential transfer) was successful, andfalseotherwise or if no action was taken.
-
logoutUser
final Unit logoutUser(Boolean clearUserAttributes)
Logout the current user and make them anonymous. This will also refresh the user's subscriptions and remove built-in attributes. Optionally, you can clear all user attributes.
- Parameters:
clearUserAttributes- If true, all user attributes will be cleared.
-
-
-
-