You can pass existing or new events to the OpenBack SDK client side, to signal and deliver a message. An event is an action at a particular moment in time for each user, which can then be used to deliver a notification. You can easily pass existing or new events to the OpenBack SDK client-side, making advanced campaigns simple.
To use an event, it must first be created in your App Settings with a unique tag - for example UserSignupComplete, LevelUp, PaymentDetailsIncomplete etc.
Then tag the same event within your app using the code from the signalEvent section.
Signal an event
When signalling an event, you can also add a delay (in seconds) which will delay the delivery of the notification. This delay can either be set in the dashboard while creating your message or it can be set client-side within your app.
To use the delay set in the dashboard, you must set the delay to a negative value within your app client-side.
For example - to create an event that will send a message when a user has their energy restored. If a user runs out of energy and you know it takes 10 minutes for that energy to restore, do the following:
Create an event called
EnergyEmptyin the Events Settings section of your App Settings and then in your code put
Cancel an event
Suppose a user opens the application and the energy is refilled, you can cancel the previous event using the following:
It will remove scheduled and active message notifications for all messages that use the given event.