Offers
Are very similar to Messages except they have even more standard fields for pricing and bundle creation. Still there are a million different ways that you can present an offer to players. Maybe only available during a certain liveops event, maybe on first login, pop-up, in the shop, etc. Each could be a little different and have different/rules/configurability needs.
In UserWise we give you the ability to create Offers Frameworks or Offer Types to add whatever customization you need.
In the SDK, these offer types will come out as a offer_type
field just like you used external_event_type
in Events to handle the additional fields and logic.
In UserWise’s SDK we give you three Offer Events you can listen to:
public event EventHandler OnLoaded
This event is triggered when the UserWise SDK has finished loading and the response from UserWise has returned. This will include both offers that are currently available and upcoming for this player.
Typically this event isn’t used unless you have some logic where say four of the same
offer_type
will be returned for the player and you need to randomly choose which version of the offer to give the player. (Note you can always access all offers via theUserWise.INSTANCE.OffersModule
)
public event EventHandler OnActive
This event is triggered for each Offer once it has loaded and is now active. For example, if the UserWise SDK returned an upcoming Offer starts in 5 minutes, it would not call OnActive until 5 minutes has passed and that offer should now be active (e.g. time limited offer pop-up).
Typically when this is called you’ll switch on the
offer_type
and handle it with some appropriate logic to turn this on. E.g. here is yourhomepage
offer for this player and here is anfeatured_shop
offer
public event EventHandler OnInactive
Very similar to above this method triggers when a Offer is no longer active - e.g. this time limited offer should no longer be available for this player.
Setting up Offer Event Listeners
In our initial setup script we can add this in
OffersModule offersModule = this.userwise.OffersModule;
offersModule.OnLoaded += OfferEventHandler.OnLoaded;
offersModule.OnActive += OfferEventHandler.OnActive;
offersModule.OnInactive += OfferEventHandler.OnInactive;
You can see an example of this here.
Powered by UserWise