Version: 2019.4
言語: 日本語
プロダクトの定義
初期化

サブスクリプションプロダクトサポート

Unity IAP は SubscriptionManager クラスでプロダクトサブスクリプション情報のクエリを サポートします。コードサンプルは Unity IAP SDK 1.19 以降に含まれる IAPDemo.cs スクリプトを参照してください。

SubscriptionManager クラスメソッド

このクラスは Apple Store と Google Play Store をサポートします。Google Play の場合は、このクラスは IAP SDK 1.19 以降を使って購入したプロダクトだけをサポートします。

メソッド 説明 
public SubscriptionInfo getSubscriptionInfo() SubscriptionInfo オブジェクト (以下を参照) を返します

SubscriptionInfo クラスメソッド

SubscriptionInfo クラスはプロダクトのサブスクリプション関連情報のコンテナーです。

メソッド 説明 
public string getProductId() プロダクトのストア ID を返します。
public DateTime getPurchaseDate() プロダクトの購入日を返します。
Apple の場合は、購入日はサブスクリプションを購入、または、更新した日を示します。Google の場合は、購入日はサブスクリプションを最初に購入した日です。
public Result isSubscribed() Result 列挙型 (enum) を返し、このプロダクトが現在購入されているか否かを示します。
Apple Store の非更新 (Non-renewable) プロダクトは Result.Unsupported 値を返します。Apple Store の自動更新 (Auto-renewable) プロダクトと Google Play Store のサブスクリプションプロダクトは、Result.TrueResult.False を返します。
public Result isExpired() Result 列挙型 (enum) を返し、このプロダクトが期限切れか否かを示します。
Apple Store の非更新 (Non-renewable) プロダクトは Result.Unsupported 値を返します。Apple Store の自動更新 (Auto-renewable) プロダクトと Google Play Store のサブスクリプションプロダクトは、Result.TrueResult.False を返します。
public Result isCancelled() Result 列挙型 (enum) を返し、このプロダクトがキャンセルされているか否かを示します。キャンセルされているサブスクリプションとは、現在はサブスクリプションされているが、次の請求日には更新しないことを意味します。
Apple Store の非更新 (Non-renewable) プロダクトは Result.Unsupported 値を返します。Apple Store の自動更新 (Auto-renewable) プロダクトと Google Play Store のサブスクリプションプロダクトは、Result.TrueResult.False を返します。
public Result isFreeTrial() Result 列挙型 (enum) を返し、このプロダクトが無料トライアルか否かを示します。* Google Play Store のプロダクトの場合、アプリケーションが Android の In-app Billing Version 6 以上をサポートしない場合は、Result.Unsupported を返します。
Apple Store の非更新 (Non-renewable) プロダクトは Result.Unsupported 値を返します。Apple Store の自動更新 (Auto-renewable) プロダクトと Google Play Store のサブスクリプションプロダクトは、Result.TrueResult.False を返します。
public Result isAutoRenewing() Result 列挙型 (enum) を返し、このプロダクトが自動更新か否かを示します。
Apple Store の非更新 (Non-renewable) プロダクトは Result.Unsupported 値を返します。Apple Store の自動更新 (Auto-renewable) プロダクトと Google Play Store のサブスクリプションプロダクトは、Result.TrueResult.False を返します。
public TimeSpan getRemainingTime() TimeSpan を返し、次の請求日までの期間を示します。
Google Play Store のプロダクトは、アプリケーションが Android の In-app Billing API Version 6 以上をサポートしない場合は、TimeSpan.MaxValue を返します。
public Result isIntroductoryPricePeriod() Result 列挙型 (enum) を返し、このプロダクトがお試し価格か否かを示します。
Apple Store の非更新 (Non-renewable) プロダクトは Result.Unsupported 値を返します。Apple Store の自動更新 (Auto-renewable) プロダクトと Google Play Store のサブスクリプションプロダクトは、Result.TrueResult.False を返します。Google Play Store のプロダクトの場合、アプリケーションが Android の In-app Billing API Version 6 以上をサポートしない場合は、Result.Unsupported を返します。
public TimeSpan getIntroductoryPricePeriod() TimeSpan を返し、お試し料金期間終了までの期間を示します。
お試し料金期間のないサブスクリプションプロダクトは TimeSpan.Zero を返します。 Apple Store のプロダクトの場合、アプリケーションが iOS バージョン 11.2 以上、macOS 10.13.2 以上、tvOS 11.2 以上のいずれかをサポートしない場合は、TimeSpan.Zero を返します。
public long getIntroductoryPricePeriodCycles() プロダクトに適用されるお試し料金期間の回数を返します。
お試し料金期間のないサブスクリプションプロダクトは TimeSpan.Zero を返します。 Apple Store のプロダクトの場合、アプリケーションが iOS バージョン 11.2 以上、macOS 10.13.2 以上、tvOS 11.2 以上のいずれかをサポートしない場合は、0 を返します。
public string getIntroductoryPrice() プロダクトのお試し料金を示す文字列を返します。
お試し料金期間のないプロダクトは "not available" を返します。 お試し料金のある Apple Store のプロダクトの場合、"0.99USD" のフォーマットの値を返します。 お試し料金のある Google Play のプロダクトの場合、"$0.99" のフォーマットの値を返します。Apple Store のプロダクトの場合、アプリケーションが iOS バージョン 11.2 以上、macOS 10.13.2 以上、tvOS 11.2 以上のいずれかをサポートしない場合は、"not available" を返します。
public DateTime getExpireDate() 次の自動更新、または契約満了 (自動更新サブスクリプションをキャンセルした場合) の日を返します。
Google Play Store のプロダクトは、アプリケーションが Android の In-app Billing API Version 6 以上をサポートしない場合は、TimeSpan.MaxValue を返します。

  • 2018–05–30 公開ページ

  • Added Subscription Product support in 2018.1 NewIn20181

プロダクトの定義
初期化