-
public final class Purchasely.BuilderBuilder class for configuring the PurchaseLy SDK. Must be called before method start() configure SDK.
-
-
Constructor Summary
Constructors Constructor Description Purchasely.Builder(Context context)
-
Method Summary
Modifier and Type Method Description final ContextgetContext()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 Purchaselybuild()Build and initialize a Purchaselyinstance with the configured settings.-
-
Constructor Detail
-
Purchasely.Builder
Purchasely.Builder(Context context)
-
-
Method Detail
-
getContext
final Context getContext()
-
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.
-
runningMode
final <ERROR CLASS> runningMode(PLYRunningMode runningMode)
Set the running mode for the PurchaseLy SDK.
- Parameters:
runningMode- The desired PLYRunningMode for Purchasely SDK.
-
build
final Purchasely build()
Build and initialize a
Purchaselyinstance with the configured settings.
-
-
-
-