Quantcast
Channel: Questions in topic: "iap"
Viewing all articles
Browse latest Browse all 595

Unity Codeless IAP restore Google Play purchase not working

$
0
0
As per this documentation: https://docs.unity3d.com/2018.1/Documentation/Manual/UnityIAPRestoringTransactions.html > On platforms that support it (e.g. Google Play and Universal Windows Applications) Unity IAP automatically restores any products the user owns during the first initialization following reinstallation; the ProcessPurchase method of your IStoreListener will be called for each owned item. But when I try to restore Unity IAP which has been created using codeless IAP, its not working at all. Its not restoring my test purchases. This is my IAPButton script in codeless IAP of Unity. #if UNITY_PURCHASING using UnityEngine.Events; using UnityEngine.UI; using System.IO; using System.Collections.Generic; namespace UnityEngine.Purchasing { [RequireComponent(typeof(Button))] [AddComponentMenu("Unity IAP/IAP Button")] [HelpURL("https://docs.unity3d.com/Manual/UnityIAP.html")] public class IAPButton : MonoBehaviour { public enum ButtonType { Purchase, Restore } [System.Serializable] public class OnPurchaseCompletedEvent : UnityEvent { }; [System.Serializable] public class OnPurchaseFailedEvent : UnityEvent { }; [HideInInspector] public string productId; [Tooltip("The type of this button, can be either a purchase or a restore button")] public ButtonType buttonType = ButtonType.Purchase; [Tooltip("Consume the product immediately after a successful purchase")] public bool consumePurchase = true; [Tooltip("Event fired after a successful purchase of this product")] public OnPurchaseCompletedEvent onPurchaseComplete; [Tooltip("Event fired after a failed purchase of this product")] public OnPurchaseFailedEvent onPurchaseFailed; [Tooltip("[Optional] Displays the localized title from the app store")] public Text titleText; [Tooltip("[Optional] Displays the localized description from the app store")] public Text descriptionText; [Tooltip("[Optional] Displays the localized price from the app store")] public Text priceText; void Start() { Button button = GetComponent

Viewing all articles
Browse latest Browse all 595

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>