-
- 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 Contextcontextprivate final <ERROR CLASS>storageprivate JobconfigureJobprivate final CoroutineContextcoroutineContextpublic final static PLYManagerINSTANCE
-
Method Summary
Modifier and Type Method Description final Unitconfigure(Function2<Boolean, PLYError, Unit> initialized)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()<ERROR CLASS>getJob()final ContextgetContext()final UnitsetContext(Context context)final <ERROR CLASS>getStorage()final JobgetConfigureJob()final UnitsetConfigureJob(Job configureJob)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()
-
getJob
<ERROR CLASS> getJob()
-
getContext
final Context getContext()
-
setContext
final Unit setContext(Context context)
-
getStorage
final <ERROR CLASS> getStorage()
-
getConfigureJob
final Job getConfigureJob()
-
setConfigureJob
final Unit setConfigureJob(Job configureJob)
-
getCoroutineContext
CoroutineContext getCoroutineContext()
-
-
-
-