Skip to content

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:

  1. Create a new class inherited from interface ISmartObjectsEvents. You can use our example SmartObjectsEventsExample.
public class SmartObjectsEventsExample : ISmartObjectsEvents

  1. Register SmartObjects listener
ExternalEvents.RegisterSmartObjectsListener(new SmartObjectsEventsExample());
  1. Make the same steps for LiveOpsStoreEventsExample if you are using our Shop
public class LiveOpsStoreEventsExample : IStoreEvents

ExternalEvents.RegisterLiveOpsListener(new LiveOpsStoreEventsExample());
  1. Whenever the LiveOps package invokes an important event, the associated method of ISmartObjectsEvents is called.
  2. Read the comments in the SmartObjectsEventsExample.cs file to understand the meaning of each method.
  3. void OnSmartObjectsInitialized(); is the starting point. Don't try to call any method of the LiveOps package before it's called.