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

image (8)
image (9)
  • Add TPPersonalizedOfferController game object to Scene.

image (10)
  • 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

image (11)
A Personalized Offer on-screen1
image (12)
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).

image (13)
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

06 TentuPlayManualOffer landscape gui

  • MessageController: A script to open and close messages

  • TentuPlayManualOffer: A TentuPlay script for Personalized Offers

07 TentuPlayManualOffer landscape scripts

Message Image: OfferImage

GUI Scripts

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_portrait: 400x640

08 OfferImage gui

TentuPlayOffer.GoToOfferEvent in On Click()

※ In Unity 2017 Version SDK OfferButton is seperated, so please check your SDK version. 09 OfferImage Scripts

CloseButton

GUI Scripts

10 CloseButton gui

TentuPlayManualOffer.CloseOfferEvent in On Click()

11 CloseButton scripts

Do Not Show Again Today: Toggle

GUI Scripts

12 Toggle gui

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

12 Toggle scripts

Need Help?

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