Section for Programmers¶
To receive important LiveOps events, such as new Offer activate/deactivate, A/B test started, Segment changed, etc... follow the next steps:
- Create a new class inherited from interface
ISmartObjectsEvents
. You can use our exampleSmartObjectsEventsExample
.
public class SmartObjectsEventsExample : ISmartObjectsEvents
{
}
- Register SmartObjects listener
ExternalEvents.RegisterSmartObjectsListener(new SmartObjectsEventsExample());
- Make the same steps for
LiveOpsStoreEventsExample
if you are using our Shop
public class LiveOpsStoreEventsExample : IStoreEvents
{
}
ExternalEvents.RegisterLiveOpsListener(new LiveOpsStoreEventsExample());
- Whenever the LiveOps package invokes an important event, the associated method of
ISmartObjectsEvents
is called. - Read the comments in the SmartObjectsEventsExample.cs file to understand the meaning of each method.
void OnSmartObjectsInitialized();
is the starting point. Don't try to call any method of the LiveOps package before it's called.