Gamebase SDK for Unity 2.75.1 Toast Gamebase Platform

Loading...
Searching...
No Matches

## ◆ RequestItemListPurchasable()

static void RequestItemListPurchasable | ( | GamebaseCallback::GamebaseDelegate< List< GamebaseResponse::Purchase::PurchasableItem > > | callback | ) |
| static

Request a item list which is purchasable.

This list has items which are registered in both Market(AppStore) and ToastCloud IAP Console.

Since
  Added 1.4.0.

Parameters

  callback | Callback pass to API result.

Example Usage :

public void RequestItemListPurchasableSample()
{
Gamebase.Purchase.RequestItemListPurchasable((purchasableItemList, error) =>
{
if (Gamebase.IsSuccess(error) == true)
{
Debug.Log("RequestItemListPurchasable succeeded");
foreach (GamebaseResponse.Purchase.PurchasableItem purchasableItem in purchasableItemList)
{
var message = new StringBuilder();
message.AppendLine(string.Format("itemSeq:{0}", purchasableItem.itemSeq));
message.AppendLine(string.Format("price:{0}", purchasableItem.price));
message.AppendLine(string.Format("currency:{0}", purchasableItem.currency));
message.AppendLine(string.Format("itemName:{0}", purchasableItem.itemName));
message.AppendLine(string.Format("marketItemId:{0}", purchasableItem.marketItemId));
Debug.Log(message);
}
}
else
{
// Check the error code and handle the error appropriately.
Debug.Log(string.Format("RequestItemListPurchasable failed. error is {0}", error));
}
});
}
Toast.Gamebase.Gamebase.Purchase.RequestItemListPurchasable
static void RequestItemListPurchasable(GamebaseCallback.GamebaseDelegate< List< GamebaseResponse.Purchase.PurchasableItem > > callback)
Request a item list which is purchasable.
Definition: Gamebase.cs:2330
Toast.Gamebase.Gamebase.Purchase
The Purchase class provides several APIs related to purchasing processes.
Definition: Gamebase.cs:2069
Toast.Gamebase.Gamebase.IsSuccess
static bool IsSuccess(GamebaseError error)
Return true if the GamebaseException object is null or the error code is zero.
Definition: Gamebase.cs:57
Toast.Gamebase.Gamebase
The Gamebase class is core of Gamebase service.
Definition: Gamebase.cs:11