public static bool IsInitialized() { #if UNITY_ANDROID return(AndroidBilling.IsInitialized()); #elif UNITY_IOS return(iOSBilling.IsInitialized()); #endif }
public static bool IsReady() { #if UNITY_ANDROID return(AndroidBilling.IsReady()); #elif UNITY_IOS return(iOSBilling.IsReady()); #endif }
public static void RestorePurchases() { #if UNITY_ANDROID AndroidBilling.RestorePurchases(); #elif UNITY_IOS iOSBilling.RestorePurchases(); #endif }
public static void Purchase(string itemId) { if (!string.IsNullOrEmpty(itemId)) { #if UNITY_ANDROID AndroidBilling.Purchase(itemId); #elif UNITY_IOS iOSBilling.Purchase(itemId); #endif } else { Debug.LogError("Could not purchase item with invalid item ID!"); } }
public static void Purchase(string itemId, string developerPayload) { if (!string.IsNullOrEmpty(itemId)) { #if UNITY_ANDROID AndroidBilling.Purchase(itemId, developerPayload); #elif UNITY_IOS // The developer payload is android only iOSBilling.Purchase(itemId); #endif } else { Debug.LogError("Could not purchase item with invalid item ID!"); } }
public static bool IsItemOwned(string itemId) { if (!string.IsNullOrEmpty(itemId)) { #if UNITY_ANDROID return(AndroidBilling.IsItemOwned(itemId)); #elif UNITY_IOS return(iOSBilling.IsItemOwned(itemId)); #endif } else { Debug.LogError("Could not check if item was owned with blank item ID!"); } return(false); }
public static void Initialize(string publicKey, ItemData[] itemList) { if (!string.IsNullOrEmpty(publicKey)) { if (itemList.Length > 0) { AndroidBilling.Initialize(publicKey, itemList); } else { Debug.LogError("Could not initialize billing with 0 items!"); } } else { Debug.LogError("Invalid billing public key!"); } }