Package 

Class Purchasely.Builder


  • 
    public final class Purchasely.Builder
    
                        

    Builder class for configuring the PurchaseLy SDK. Must be called before method start() configure SDK.

    • Field Summary

      Fields 
      Modifier and Type Field Description
      private final Context context
    • Method Summary

      Modifier and Type Method Description
      final Context getContext()
      final <ERROR CLASS> apiKey(String apiKey) Set your Purchasely API Key.
      final <ERROR CLASS> userId(String userId) Your can set an user id to link your user to his purchases If not set the purchase will be anonymousAlso the purchasely fragment will display a button to allow your user to login that will emit a PLYEvent.LoginTapped which must be catch on your side with eventListener
      final <ERROR CLASS> stores(List<Store> list) Each store handled by Purchasely has its own dependency You need to add them here to use them with the SDK You can set multiples stores which are listed by priority, Purchasely will use the first one available for the user.
      final <ERROR CLASS> logLevel(LogLevel level) Set the log level for the PurchaseLy SDK.
      final <ERROR CLASS> readyToOpenDeeplink(Boolean ready) Set whether the SDK is ready to open deep links.
      final <ERROR CLASS> runningMode(PLYRunningMode runningMode) Set the running mode for the PurchaseLy SDK.
      final Purchasely build() Build and initialize a Purchasely instance with the configured settings.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • Purchasely.Builder

        Purchasely.Builder(Context context)
    • Method Detail

      • apiKey

         final <ERROR CLASS> apiKey(String apiKey)

        Set your Purchasely API Key. This field is mandatory.

        Parameters:
        apiKey - api key from Purchasely dashboard.
      • userId

         final <ERROR CLASS> userId(String userId)

        Your can set an user id to link your user to his purchases If not set the purchase will be anonymous

        Also the purchasely fragment will display a button to allow your user to login that will emit a PLYEvent.LoginTapped which must be catch on your side with eventListener

        Parameters:
        userId - id of user.
      • stores

         final <ERROR CLASS> stores(List<Store> list)

        Each store handled by Purchasely has its own dependency You need to add them here to use them with the SDK You can set multiples stores which are listed by priority, Purchasely will use the first one available for the user.

        Example with Google Play used if available :

        listOf(GoogleStore.create(), HuaweiStore.create())

        Parameters:
        list - list of Store.
      • logLevel

         final <ERROR CLASS> logLevel(LogLevel level)

        Set the log level for the PurchaseLy SDK.

        Parameters:
        level - The desired log level for logging SDK activities.
      • readyToOpenDeeplink

         final <ERROR CLASS> readyToOpenDeeplink(Boolean ready)

        Set whether the SDK is ready to open deep links.

        Parameters:
        ready - Indicates whether the SDK is ready to open deep links.
      • build

         final Purchasely build()

        Build and initialize a Purchasely instance with the configured settings.