Gamebase SDK for Unity 2.76.0 Toast Gamebase Platform

Loading...
Searching...
No Matches

## ◆ RequestSubscriptionsStatus()

static void RequestSubscriptionsStatus | ( | GamebaseRequest.Purchase.PurchasableConfiguration | configuration,
|  | GamebaseCallback.GamebaseDelegate< List< GamebaseResponse.Purchase.PurchasableSubscriptionStatus > > | callback )
| static

Request a list of purchased subscription status.

This API will work with Google store. (Android Only)

Since
  Added 2.46.0.

Parameters

  configuration | Sets additional conditions for retrieving results.
  callback | Callback pass to API result.

Example Usage :

public void RequestSubscriptionsStatusSample(bool includeExpiredSubscriptions)
{
var configuration = new GamebaseRequest.Purchase.PurchasableConfiguration
{
includeExpiredSubscriptions = includeExpiredSubscriptions
};
Gamebase.Purchase.RequestSubscriptionsStatus(configuration, (subscriptionStatusList, error) =>
{
if (Gamebase.IsSuccess(error) == true)
{
Debug.Log("RequestSubscriptionsStatus succeeded");
foreach (GamebaseResponse.Purchase.PurchasableSubscriptionStatus subscriptionStatus in subscriptionStatusList)
{
var message = new StringBuilder();
message.AppendLine(string.Format("storeCode:{0}", subscriptionStatus.storeCode));
message.AppendLine(string.Format("paymentId:{0}", subscriptionStatus.paymentId));
message.AppendLine(string.Format("originalPaymentId:{0}", subscriptionStatus.originalPaymentId));
message.AppendLine(string.Format("paymentSeq:{0}", subscriptionStatus.paymentSeq));
message.AppendLine(string.Format("marketItemId:{0}", subscriptionStatus.marketItemId));
message.AppendLine(string.Format("itemSeq:{0}", subscriptionStatus.itemSeq));
message.AppendLine(string.Format("price:{0}", subscriptionStatus.price));
message.AppendLine(string.Format("currency:{0}", subscriptionStatus.currency));
message.AppendLine(string.Format("purchaseTime:{0}", subscriptionStatus.purchaseTime));
message.AppendLine(string.Format("expiryTime:{0}", subscriptionStatus.expiryTime));
// Subscription status
// Refer to the following document for the entire status code.
// https://docs.nhncloud.com/en/TOAST/en/toast-sdk/iap-unity/#iapsubscriptionstatusstatus
message.AppendLine(string.Format("statusCode:{0}", subscriptionStatus.statusCode));
message.AppendLine(string.Format("statusDescription:{0}", subscriptionStatus.statusDescription));
message.AppendLine(string.Format("gamebaseProductId:{0}", subscriptionStatus.gamebaseProductId));
Debug.Log(message);
}
}
else
{
// Check the error code and handle the error appropriately.
Debug.Log(string.Format("RequestSubscriptionsStatus failed. error is {0}", error));
}
});
}
Toast.Gamebase.Gamebase.Purchase.RequestSubscriptionsStatus
static void RequestSubscriptionsStatus(GamebaseRequest.Purchase.PurchasableConfiguration configuration, GamebaseCallback.GamebaseDelegate< List< GamebaseResponse.Purchase.PurchasableSubscriptionStatus > > callback)
Request a list of purchased subscription status.
Definition Gamebase.cs:2550
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