Quantcast
Channel: Questions in topic: "ios"
Viewing all articles
Browse latest Browse all 4709

Recipets not created on iOS before restoring purchases

$
0
0
Hello, I am using the latest IAP package for 2017.2.1p4 (1.20.1). To make I am not doing something incorrectly, I used the IAP Demo scene, and only changed the products that are added. This is the scenario - 1. Purchase a non-consumable product on the app, and completely close it. (just closing, nothing more) 2. Run app again, initialising Unity IAP. 3. Look for the receipt of the product you've previously purchased. Expected : receipt member of Product should not be null or empty Actual : it is. Only after successfully restoring purchases the receipt is populated. This happens only with non-consumables. With subscription I do get the receipt right after OnInitialised. This issue is relevant to me only on iOS (on Android it automatically calls restore purchases so no problems there), also should be mentioned I am working in a sandbox environment (i.e. testing iap environment). I need this receipt before RestorePurchase because I need to detect refunds and potentially re-add monetisation. Thanks, Shmulik. The code I'm using - #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 4709

Trending Articles



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