-
public final class TriggerManagerResponsible for storing triggers count for a given campaign ID. It stores triggers in the shared preferences named "WizRocket_triggers_per_inapp:<<account_id>>:<<device_id>>" with keys in the format "_triggers<<campaign_id>>".
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public classTriggerManager.Companion
-
Field Summary
Fields Modifier and Type Field Description private WeakReference<Context>contextRef
-
Constructor Summary
Constructors Constructor Description TriggerManager(Context context, String accountId, DeviceInfo deviceInfo)
-
Method Summary
Modifier and Type Method Description final WeakReference<Context>getContextRef()final UnitsetContextRef(WeakReference<Context> contextRef)final IntegergetTriggers(String campaignId)Retrieves the trigger count for a given campaign ID. final Unitincrement(String campaignId)Increments the trigger count for a given campaign ID. final UnitremoveTriggers(String campaignId)Removes the trigger count for a given campaign ID. final SharedPreferencessharedPrefs()Retrieves the shared preferences instance for storing trigger counts. final StringgetTriggersKey(String campaignId)Generates the storage key for trigger counts for a given campaign ID. -
-
Constructor Detail
-
TriggerManager
TriggerManager(Context context, String accountId, DeviceInfo deviceInfo)
-
-
Method Detail
-
getContextRef
final WeakReference<Context> getContextRef()
-
setContextRef
final Unit setContextRef(WeakReference<Context> contextRef)
-
getTriggers
final Integer getTriggers(String campaignId)
Retrieves the trigger count for a given campaign ID.
- Parameters:
campaignId- The identifier of the In-App campaign.
-
increment
final Unit increment(String campaignId)
Increments the trigger count for a given campaign ID.
- Parameters:
campaignId- The identifier of the In-App campaign.
-
removeTriggers
final Unit removeTriggers(String campaignId)
Removes the trigger count for a given campaign ID.
- Parameters:
campaignId- The identifier of the In-App campaign.
-
sharedPrefs
final SharedPreferences sharedPrefs()
Retrieves the shared preferences instance for storing trigger counts.
-
getTriggersKey
final String getTriggersKey(String campaignId)
Generates the storage key for trigger counts for a given campaign ID.
- Parameters:
campaignId- The identifier of the In-App campaign.
-
-
-
-