Package 

Object PLYUserManager

    • Method Summary

      Modifier and Type Method Description
      final Unit loginUser(String userId, Function1<Boolean, Unit> callback) Logs in the user with the given userId.
      final Unit logoutUser(Boolean clearUserAttributes) Logout the current user and make them anonymous.
      final Unit close()
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 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 with true if the login (and potential transfer) was successful, and false otherwise 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.