-
- 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()final Pair<Boolean, String>isConfigured()The Booleanvalue indicates whether the app is configured correctly.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 PLYActiveSubscriptionsStorage and PLYExpiredSubscriptionsStorage. 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()
-
isConfigured
final Pair<Boolean, String> isConfigured()
The
Booleanvalue indicates whether the app is configured correctly. TheStringvalue indicates the reason why the app is not configured correctly, if it is not configured correctly.The app is considered to be configured correctly if all of the following conditions are met:
// Previously : The
PLYStoreManagerhas a store.The
storagehas at least one product.The
PLYManagerhas a context.
-
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 PLYActiveSubscriptionsStorage and PLYExpiredSubscriptionsStorage.
-
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()
-
-
-
-