-
- All Implemented Interfaces:
-
androidx.lifecycle.DefaultLifecycleObserver,androidx.lifecycle.LifecycleObserver
public class PLYSessionManager implements DefaultLifecycleObserver
-
-
Field Summary
Fields Modifier and Type Field Description private DatedisplayedStartedAtprivate PLYPresentationpresentationprivate StringstoreCountryCodeprivate UUIDsessionIdprivate DatesessionStartDateprivate <ERROR CLASS>numberOfAppSessionsprivate DatelastAppSessionAtprivate DatecurrentSessionAtprivate IntegerconsecutiveDaysOpenedprivate BooleanhasExpiredSubscriptionprivate BooleanhasNonConsumablepublic final static PLYSessionManagerINSTANCE
-
Method Summary
Modifier and Type Method Description UnitonStop(LifecycleOwner owner)UnitonStart(LifecycleOwner owner)final UnitstartNewSession()Start a new session. final <ERROR CLASS>sessionStorageToMap()Returns the content of the storage as a map. final UnitupdateActiveSubscriptionsStorage(List<PLYSubscriptionData> activeSubscriptions)Update the storage with the list of active subscriptions. final UnitupdateExpiredSubscriptionsStorage(List<PLYSubscriptionData> expiredSubscriptions)Update the storage with the list of expired subscriptions. final UnitsetOfferEligibility()Update the storage with the products and plans eligible to offer. final UnitclearStorage()Clear all the data stored in PLYSessionStorage related to the user's subscriptions. final UnitclearSubscriptionsStorage()Clear all the data stored in PLYSessionStorage related to the user's subscriptions. final BooleanisApplicationVisible()Check whether the application is visible or not. final <ERROR CLASS>hasExpiredSubscriptionsAlreadySet()final UnitclearAll()final Unitregister()final UnitactivityStarted()final UnitactivityStopped()final DategetDisplayedStartedAt()final UnitsetDisplayedStartedAt(Date displayedStartedAt)final PLYPresentationgetPresentation()final UnitsetPresentation(PLYPresentation presentation)final StringgetStoreCountryCode()final UnitsetStoreCountryCode(String storeCountryCode)final UUIDgetSessionId()final UnitsetSessionId(UUID sessionId)final DategetSessionStartDate()final UnitsetSessionStartDate(Date sessionStartDate)final <ERROR CLASS>getNumberOfAppSessions()final Unit)>setNumberOfAppSessions(<ERROR CLASS> numberOfAppSessions)final DategetLastAppSessionAt()final UnitsetLastAppSessionAt(Date lastAppSessionAt)final DategetCurrentSessionAt()final UnitsetCurrentSessionAt(Date currentSessionAt)final IntegergetConsecutiveDaysOpened()final UnitsetConsecutiveDaysOpened(Integer consecutiveDaysOpened)final BooleangetHasExpiredSubscription()final UnitsetHasExpiredSubscription(Boolean hasExpiredSubscription)final BooleangetHasNonConsumable()final UnitsetHasNonConsumable(Boolean hasNonConsumable)-
-
Method Detail
-
onStop
Unit onStop(LifecycleOwner owner)
-
onStart
Unit onStart(LifecycleOwner owner)
-
startNewSession
final Unit startNewSession()
Start a new session. This method should be called when the application is started, and set the session related data (id, dates, etc...)
-
sessionStorageToMap
final <ERROR CLASS> sessionStorageToMap()
Returns the content of the storage as a map.
-
updateActiveSubscriptionsStorage
final Unit updateActiveSubscriptionsStorage(List<PLYSubscriptionData> activeSubscriptions)
Update the storage with the list of active subscriptions.
-
updateExpiredSubscriptionsStorage
final Unit updateExpiredSubscriptionsStorage(List<PLYSubscriptionData> expiredSubscriptions)
Update the storage with the list of expired subscriptions.
-
setOfferEligibility
final Unit setOfferEligibility()
Update the storage with the products and plans eligible to offer.
-
clearStorage
final Unit clearStorage()
Clear all the data stored in PLYSessionStorage related to the user's subscriptions.
-
clearSubscriptionsStorage
final Unit clearSubscriptionsStorage()
Clear all the data stored in PLYSessionStorage related to the user's subscriptions.
-
isApplicationVisible
final Boolean isApplicationVisible()
Check whether the application is visible or not.
-
hasExpiredSubscriptionsAlreadySet
final <ERROR CLASS> hasExpiredSubscriptionsAlreadySet()
-
activityStarted
final Unit activityStarted()
-
activityStopped
final Unit activityStopped()
-
getDisplayedStartedAt
final Date getDisplayedStartedAt()
-
setDisplayedStartedAt
final Unit setDisplayedStartedAt(Date displayedStartedAt)
-
getPresentation
final PLYPresentation getPresentation()
-
setPresentation
final Unit setPresentation(PLYPresentation presentation)
-
getStoreCountryCode
final String getStoreCountryCode()
-
setStoreCountryCode
final Unit setStoreCountryCode(String storeCountryCode)
-
getSessionId
final UUID getSessionId()
-
setSessionId
final Unit setSessionId(UUID sessionId)
-
getSessionStartDate
final Date getSessionStartDate()
-
setSessionStartDate
final Unit setSessionStartDate(Date sessionStartDate)
-
getNumberOfAppSessions
final <ERROR CLASS> getNumberOfAppSessions()
-
setNumberOfAppSessions
final Unit )>setNumberOfAppSessions(<ERROR CLASS> numberOfAppSessions)
-
getLastAppSessionAt
final Date getLastAppSessionAt()
-
setLastAppSessionAt
final Unit setLastAppSessionAt(Date lastAppSessionAt)
-
getCurrentSessionAt
final Date getCurrentSessionAt()
-
setCurrentSessionAt
final Unit setCurrentSessionAt(Date currentSessionAt)
-
getConsecutiveDaysOpened
final Integer getConsecutiveDaysOpened()
-
setConsecutiveDaysOpened
final Unit setConsecutiveDaysOpened(Integer consecutiveDaysOpened)
-
getHasExpiredSubscription
final Boolean getHasExpiredSubscription()
-
setHasExpiredSubscription
final Unit setHasExpiredSubscription(Boolean hasExpiredSubscription)
-
getHasNonConsumable
final Boolean getHasNonConsumable()
-
setHasNonConsumable
final Unit setHasNonConsumable(Boolean hasNonConsumable)
-
-
-
-