Use Personalized Offer SDK

Before We Start

Personalized offers are only available for TENTUPLAY SDK v2021.2, or later versions, so please check your SDK version.

Before sending personalized offers via the console, please download the SDK. Learn more about how to create a project

TPPersonalizedOfferController

When ShowOfferById or ShowLatestOffer is called, TPPersonalizedOffeController will dynamically retrieve offers by player (player_uuid) and show them on Scene.

  • ShowOfferById and ShowLatestOffer are methods of the TPPersonalizedOffer class,

    TPPersonalizedOffer is a class for displaying TentuPlay Personalized Offers and AI In-Game Shop offers.

Utilizing in Unity

TPPersonalizedOfferController.prefab can be found in the location below, and contains TPPersonalizedOfferController.cs script as a component.

  • Assets/TentuPlay/TPPersonalizedOfferTemplates/TPPersonalizedOfferController.prefab

  • Add TPPersonalizedOfferController game object to Scene.

  • Utilize tpPersonalizedOfferController GameObject parameter value to call ShowOfferById or ShowLatestOffer. After, TentuPlay will automatically show offers. Please refer to the example code and screen below.

Example Code

  • For more in-depth examples, check Assets/ShingGoongDemo/Scripts/TentuplayRelated/TentuPlayCRMPlayerController.cs and Assets/ShingGoongDemo/Scripts/TentuplayRelated/MailBoxOpen_offer.cs.

public void ShowPersonalizedOffer()
{
TPPersonalizedOffer myTPOffer = new TPPersonalizedOffer();
StartCoroutine(
myTPOffer.ShowOfferById(tpPersonalizedOfferController, player_uuid, "en", offer_id, (response => { })));
}

Example Screen

[A Personalized Offer on-screen1]
[A Personalized Offer on-screen2]

If ShowOfferById or ShowLatestOffer is called TentuPlayManualOffer_landscape or TentuPlayManualOffer_portrait is generated on Scene as a child of TPPersonalizedOfferController (TPPersonalizedOfferController.ShowOffer). The image entered via the console becomes a Texture/Raw Image of OfferImage (differs by version).

[TentuPlayManualOffer_landscape generated as a child of TPPersonalizedOfferController]

Personalized Offers and AI In-Game Shop offers are differentiated by OfferInfo.offerType.

UI (Details)

An explanation of TentuPlayManualOffer_landscape, TentuPlayManualOffer_portrait.

TentuPlayManualOffer_landscape.prefab

GUI

Scripts

- MessageController: A script to open and close messages - TentuPlayManualOffer: A TentuPlay script for Personalized Offers

Message Image: OfferImage

GUI

Scrpts

While the default size is set in the console (580x896px), if you set a new size in OfferImage the size will be set to the entered values. ※ Default Sizes - TentuPlayManualOffer_landscape: 640x400 - TentuPlayManualOffer_landscape: 400x640

TentuPlayOffer.GoToOfferEvent in On Click() ※ In Unity 2017 Version SDK OfferButton is seperated, so please check your SDK version.

CloseButton

GUI

Scripts

TentuPlayManualOffer.CloseOfferEvent in On Click()

Do Not Show Again Today: Toggle

GUI

Scripts

On Value Changed에 TentuPlayOffer.CheckDoNotShowToday. If you wish to use a <Do Not Show Again> button, edit to use MarkDoNotShowAgain method.

Need Help?

Do you have questions? Join TENTUPLAY Discord if you have any questions.