//-------------------------------------- // Action Handlers //-------------------------------------- static void ClientPurchaseFinishedHadnler(UM_PurchaseResult result) { if (!result.product.IsConsumable && result.isSuccess) { UM_InAppPurchaseManager.SaveNonConsumableItemPurchaseInfo(result.product); } }
private void OnRetrieveProductsFinised(BillingResult result) { AndroidInAppPurchaseManager.ActionRetrieveProducsFinished -= OnRetrieveProductsFinised; UM_BillingConnectionResult r = new UM_BillingConnectionResult(); r.message = result.Message; r.isSuccess = result.IsSuccess; _IsConnected = r.isSuccess; if (r.isSuccess) { foreach (UM_InAppProduct product in UltimateMobileSettings.Instance.InAppProducts) { GoogleProductTemplate tpl = AndroidInAppPurchaseManager.Client.Inventory.GetProductDetails(product.AndroidId); if (tpl != null) { product.SetTemplate(tpl); if (product.IsConsumable && AndroidInAppPurchaseManager.Client.Inventory.IsProductPurchased(product.AndroidId)) { AndroidInAppPurchaseManager.Client.Consume(product.AndroidId); } if (!product.IsConsumable && AndroidInAppPurchaseManager.Client.Inventory.IsProductPurchased(product.AndroidId)) { UM_InAppPurchaseManager.SaveNonConsumableItemPurchaseInfo(product); } } } } SendServiceConnectedEvent(r); }
//-------------------------------------- // Event Handlers //-------------------------------------- private void OnInitComplete(WP8_InAppsInitResult result) { _IsConnected = true; UM_BillingConnectionResult r = new UM_BillingConnectionResult(); r.message = "Inited"; r.isSuccess = true; foreach (UM_InAppProduct product in UltimateMobileSettings.Instance.InAppProducts) { WP8ProductTemplate tpl = WP8InAppPurchasesManager.Instance.GetProductById(product.WP8Id); if (tpl != null) { product.SetTemplate(tpl); if (product.WP8Template.IsPurchased && !product.IsConsumable) { UM_InAppPurchaseManager.SaveNonConsumableItemPurchaseInfo(product); } } } SendServiceConnectedEvent(r); }
public bool IsProductPurchased(string productId) { UM_InAppProduct product = UM_InAppPurchaseManager.GetProductById(productId); if (product != null) { return(IsProductPurchased(product)); } else { return(false); } }
public void FinishTransaction(string productId) { UM_InAppProduct product = UM_InAppPurchaseManager.GetProductById(productId); if (product != null) { FinishTransaction(product); } else { SendNoTemplateEvent(); } }
public void Consume(string productId) { UM_InAppProduct product = UM_InAppPurchaseManager.GetProductById(productId); if (product != null) { Consume(product); } else { SendNoTemplateEvent(); } }
public virtual bool IsProductPurchased(UM_InAppProduct product) { return(UM_InAppPurchaseManager.IsLocalPurchaseRecordExists(product)); }