-
- All Implemented Interfaces:
-
io.purchasely.common.PLYCoroutineScope,kotlinx.coroutines.CoroutineScope
public class PLYManager implements PLYCoroutineScope
-
-
Field Summary
Fields Modifier and Type Field Description private final <ERROR CLASS>jobprivate final <ERROR CLASS>storageprivate final CoroutineContextcoroutineContextpublic final static PLYManagerINSTANCE
-
Method Summary
Modifier and Type Method Description final Unitclose()final BooleanisInitialized()The Booleanvalue indicates whether thecontextis initialized.final BooleanisConfigured()Checks if the SDK is configured. final Unitpurchase(Activity activity, PLYPlan plan, PLYPromoOffer offer)final <ERROR CLASS>checkReceipt(String receiptId)final UnitrestorePurchases(Boolean isSilent)final UnitsynchronizePurchases()final List<PLYSubscriptionData>getInternalUserSubscriptions()final List<PLYSubscriptionData>getActiveSubscriptions(Boolean invalidateCache)Return a list of PLYSubscriptionData corresponding to the user's active subscriptions. final List<PLYSubscriptionData>getExpiredSubscriptions(Boolean invalidateCache)Return a list of PLYSubscriptionData corresponding to the user's expired subscriptions. final UnitfetchRemoteSubscriptions()Fetches the user's active and expired subscriptions from the server and saves them in io.purchasely.storage.userSubscriptions.PLYUserSubscriptionsStorage. final ContextgetSafeContext()final ContextrequireContext()final Unitconfigure(Function2<Boolean, PLYError, Unit> initialized)final Unitinit()final BooleanwaitingToConfigure()final UnitstartConfiguration()<ERROR CLASS>getJob()final <ERROR CLASS>getStorage()CoroutineContextgetCoroutineContext()-
-
Method Detail
-
isInitialized
final Boolean isInitialized()
The
Booleanvalue indicates whether thecontextis initialized. This is useful to know if we can start any action where application context is required
-
isConfigured
final Boolean isConfigured()
Checks if the SDK is configured.
The SDK is considered configured if it has been initialized and the SDK has started successfully.
-
purchase
final Unit purchase(Activity activity, PLYPlan plan, PLYPromoOffer offer)
-
checkReceipt
final <ERROR CLASS> checkReceipt(String receiptId)
-
restorePurchases
final Unit restorePurchases(Boolean isSilent)
-
synchronizePurchases
final Unit synchronizePurchases()
-
getInternalUserSubscriptions
final List<PLYSubscriptionData> getInternalUserSubscriptions()
-
getActiveSubscriptions
final List<PLYSubscriptionData> getActiveSubscriptions(Boolean invalidateCache)
Return a list of PLYSubscriptionData corresponding to the user's active subscriptions.
-
getExpiredSubscriptions
final List<PLYSubscriptionData> getExpiredSubscriptions(Boolean invalidateCache)
Return a list of PLYSubscriptionData corresponding to the user's expired subscriptions.
-
fetchRemoteSubscriptions
final Unit fetchRemoteSubscriptions()
Fetches the user's active and expired subscriptions from the server and saves them in io.purchasely.storage.userSubscriptions.PLYUserSubscriptionsStorage.
-
getSafeContext
final Context getSafeContext()
-
requireContext
final Context requireContext()
-
waitingToConfigure
final Boolean waitingToConfigure()
-
startConfiguration
final Unit startConfiguration()
-
getJob
<ERROR CLASS> getJob()
-
getStorage
final <ERROR CLASS> getStorage()
-
getCoroutineContext
CoroutineContext getCoroutineContext()
-
-
-
-