Gamebase SDK for Unity  2.1.0
Toast Gamebase Platform

◆ SetPromotionIAPHandler()

static void SetPromotionIAPHandler ( GamebaseCallback.GamebaseDelegate< GamebaseResponse.Purchase.PurchasableReceipt >  callback)
static

If you want to deliver some items that have been purchased to user, you should implement this handler.

You can receive a GamebaseResponse.Purchase.PurchasableReceipt object and receive whether error or success by callback. This API return same information with 'RequestPurchase' You should call this method after logged in, and you sould call this before an other APIs in Gamebase.Purchase. This API can work on iOS11 or later.

Since
Added 1.13.0.
Parameters
callbackCallback may return the result of purchase by App Store Promotion.

Example Usage :

{
Gamebase.Purchase.SetPromotionIAPHandler((purchasableReceipt, error) =>
{
if (Gamebase.IsSuccess(error))
{
Debug.Log("RequestPurchase succeeded");
Debug.Log("itemSeq : " + purchasableReceipt.itemSeq);
Debug.Log("price : " + purchasableReceipt.price);
Debug.Log("currency : " + purchasableReceipt.currency);
Debug.Log("paymentSeq : " + purchasableReceipt.paymentSeq);
Debug.Log("purchaseToken : " + purchasableReceipt.purchaseToken);
}
else
{
if (error.code == GamebaseErrorCode.PURCHASE_USER_CANCELED)
{
Debug.Log("User canceled purchase.");
}
else
{
Debug.Log(string.Format("Purchase failed. error is {0}", error));
}
}
});
}