-
public interface IInAppMessagesManagerThe In App Message (IAM) Manager is a device-scoped manager for controlling the IAM functionality within your application. By default IAMs are enabled and will present if the current user qualifies for any IAMs sent down by the OneSignal backend. To blanket disable IAMs, set paused to
trueon startup.
-
-
Method Summary
Modifier and Type Method Description abstract UnitaddTrigger(String key, String value)Add a trigger for the current user. abstract UnitaddTriggers(Map<String, String> triggers)Add multiple triggers for the current user. abstract UnitremoveTrigger(String key)Remove the trigger with the provided key from the current user. abstract UnitremoveTriggers(Collection<String> keys)Remove multiple triggers from the current user. abstract UnitclearTriggers()Clear all triggers from the current user. abstract UnitaddLifecycleListener(IInAppMessageLifecycleListener listener)Add a lifecycle listener that will run whenever an In App Message lifecycle event occurs. abstract UnitremoveLifecycleListener(IInAppMessageLifecycleListener listener)Remove a lifecycle listener that has been previously added. abstract UnitaddClickListener(IInAppMessageClickListener listener)Add a click listener that will run whenever an In App Message is clicked on by the user. abstract UnitremoveClickListener(IInAppMessageClickListener listener)Remove a click listener that has been previously added. abstract BooleangetPaused()Whether the In-app messaging is currently paused. abstract UnitsetPaused(Boolean paused)Whether the In-app messaging is currently paused. -
-
Method Detail
-
addTrigger
abstract Unit addTrigger(String key, String value)
Add a trigger for the current user. Triggers are currently explicitly used to determine whether a specific IAM should be displayed to the user. See Triggers | OneSignal.
If the trigger key already exists, it will be replaced with the value provided here. Note that triggers are not persisted to the backend. They only exist on the local device and are applicable to the current user.
- Parameters:
key- The key of the trigger that is to be set.value- The value of the trigger.
-
addTriggers
abstract Unit addTriggers(Map<String, String> triggers)
Add multiple triggers for the current user. Triggers are currently explicitly used to determine whether a specific IAM should be displayed to the user. See Triggers | OneSignal.
If the trigger key already exists, it will be replaced with the value provided here. Note that triggers are not persisted to the backend. They only exist on the local device and are applicable to the current user.
- Parameters:
triggers- The map of triggers that are to be added to the current user.
-
removeTrigger
abstract Unit removeTrigger(String key)
Remove the trigger with the provided key from the current user.
- Parameters:
key- The key of the trigger.
-
removeTriggers
abstract Unit removeTriggers(Collection<String> keys)
Remove multiple triggers from the current user.
- Parameters:
keys- The collection of keys, all of which will be removed from the current user.
-
clearTriggers
abstract Unit clearTriggers()
Clear all triggers from the current user.
-
addLifecycleListener
abstract Unit addLifecycleListener(IInAppMessageLifecycleListener listener)
Add a lifecycle listener that will run whenever an In App Message lifecycle event occurs.
- Parameters:
listener- : The listener that is to be called when the event occurs.
-
removeLifecycleListener
abstract Unit removeLifecycleListener(IInAppMessageLifecycleListener listener)
Remove a lifecycle listener that has been previously added.
- Parameters:
listener- The previously added listener that should be removed.
-
addClickListener
abstract Unit addClickListener(IInAppMessageClickListener listener)
Add a click listener that will run whenever an In App Message is clicked on by the user.
- Parameters:
listener- The listener that is to be called when the event occurs.
-
removeClickListener
abstract Unit removeClickListener(IInAppMessageClickListener listener)
Remove a click listener that has been previously added.
- Parameters:
listener- The previously added listener that should be removed.
-
getPaused
abstract Boolean getPaused()
Whether the In-app messaging is currently paused. When set to
trueno IAM will be presented to the user regardless of whether they qualify for them. When set to 'false` any IAMs the user qualifies for will be presented to the user at the appropriate time.
-
setPaused
abstract Unit setPaused(Boolean paused)
Whether the In-app messaging is currently paused. When set to
trueno IAM will be presented to the user regardless of whether they qualify for them. When set to 'false` any IAMs the user qualifies for will be presented to the user at the appropriate time.
-
-
-
-