Search Unity

[Solved] Always get false when restore purchase on iOS

Discussion in 'Unity IAP' started by Deleted User, Mar 24, 2016.

Thread Status:
Not open for further replies.
  1. Deleted User

    Deleted User

    Guest

    I can buy product successfully.
    But When I restore purchase,I always get false in the following codes
    Code (CSharp):
    1. if (Application.platform == RuntimePlatform.IPhonePlayer ||
    2.             Application.platform == RuntimePlatform.OSXPlayer)
    3.         {
    4.             // ... begin restoring purchases
    5.             Debug.Log("RestorePurchases started ...");
    6.  
    7.             // Fetch the Apple store-specific subsystem.
    8.             var apple = m_StoreExtensionProvider.GetExtension<IAppleExtensions>();
    9.             // Begin the asynchronous process of restoring purchases. Expect a confirmation response in the Action<bool> below, and ProcessPurchase if there are previously purchased products to restore.
    10.             apple.RestoreTransactions((result) => {
    11.                 // The first phase of restoration. If no more responses are received on ProcessPurchase then no purchases are available to be restored.
    12.                 Debug.Log("RestorePurchases continuing: " + result + ". If no further messages, no purchases available to restore.");
    13.             });
    14.         }
    the result is always false,how to handle this?
     
  2. nicholasr

    nicholasr

    Joined:
    Aug 15, 2015
    Posts:
    183
    Hi @floatingland - Is the game using Consumables, and no NonConsumable? I am guessing the 'false' response could be due to Consumable purchase - they are not able to be Restored. Also 'false' is when the user password mismatches, or the user Cancels the dialog.
     
  3. Banderous

    Banderous

    Joined:
    Dec 25, 2011
    Posts:
    669
    Take a look at the debug trace from XCode, that'll have more information.
     
  4. Deleted User

    Deleted User

    Guest

    This morning it's ok again,and i didn't do anything.It's not stable I think.
     
  5. Deleted User

    Deleted User

    Guest

    Both Consumables and NonConsumables are in my ip.Now it's ok,still don't know why,cause I didn't do anything,and it's ok again.
     
    nicholasr likes this.
Thread Status:
Not open for further replies.