-
- All Implemented Interfaces:
-
androidx.lifecycle.DefaultLifecycleObserver,androidx.lifecycle.LifecycleObserver,io.purchasely.common.PLYCoroutineScope,kotlinx.coroutines.CoroutineScope
public class PLYEventManager implements PLYCoroutineScope, DefaultLifecycleObserver
-
-
Field Summary
Fields Modifier and Type Field Description private final <ERROR CLASS>jobprivate final CoroutineContextcoroutineContextpublic final static PLYEventManagerINSTANCE
-
Method Summary
Modifier and Type Method Description final <ERROR CLASS>newEvent(PLYEvent event)Processes a new event received by the SDK. final Unitreset()<ERROR CLASS>getJob()CoroutineContextgetCoroutineContext()-
-
Method Detail
-
newEvent
final <ERROR CLASS> newEvent(PLYEvent event)
Processes a new event received by the SDK.
This function handles various operations related to a new event, including:
Logging event details.
Determining if the event should trigger listeners and campaigns based on its type and properties.
Notifying the registered Purchasely.eventListener if applicable.
Storing the event in the local storage.
Processing the event for campaigns through PLYCampaignManager.
Updating presentation and campaign related data in PLYUserDataStorage for events like "PRESENTATION_VIEWED" and "PRESENTATION_CLOSED".
Handling event batching and triggering the sending of events based on priority and queue status.
Starting periodic tasks for sending event batches if not already running and if there are events in the queue.
- Parameters:
event- The PLYEvent object representing the new event.
-
getJob
<ERROR CLASS> getJob()
-
getCoroutineContext
CoroutineContext getCoroutineContext()
-
-
-
-