Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice
  4. Dismiss Notice

UNITY 2019.2.7f2 OnPurchaseFailed bug

Discussion in 'Unity IAP' started by MelbotStudios, Feb 23, 2021.

Thread Status:
Not open for further replies.
  1. MelbotStudios

    MelbotStudios

    Joined:
    Jan 29, 2018
    Posts:
    7
    Unity: 2019.2.7f2
    In App Purchassing: 2.0.6 and 2.2.2
    Unity IAP : 2.2.7

    Hi,

    Every time that we try to buy a product, ProcessPurchase is not called but OnPurchaseFailed is called with failureReason Unknown.
    If i close and open the apk, the ProcessPurchase is called.

    Is there a IAP version that I can use and it works with unity 2019.2.7f2?


    Many thanks.
     
  2. JeffDUnity3D

    JeffDUnity3D

    Unity Technologies

    Joined:
    May 2, 2017
    Posts:
    14,446
  3. MelbotStudios

    MelbotStudios

    Joined:
    Jan 29, 2018
    Posts:
    7

    Attached Files:

  4. MelbotStudios

    MelbotStudios

    Joined:
    Jan 29, 2018
    Posts:
    7
    upload_2021-2-23_17-29-1.png
    upload_2021-2-23_17-29-35.png

    And if i restart the app:
    upload_2021-2-23_17-30-8.png
     
  5. JeffDUnity3D

    JeffDUnity3D

    Unity Technologies

    Joined:
    May 2, 2017
    Posts:
    14,446
    Your logs say the purchase was a success. Regardless, same recommendations apply. Test with the Sample IAP project to compare. You've installed the Google Play Services plugin which may cause compatibility issues, narrow down the problem.
     
  6. MelbotStudios

    MelbotStudios

    Joined:
    Jan 29, 2018
    Posts:
    7
    Yep, the purchase was success works when i restart the app, but if i don't it throws a purchase failed, if i click again the purchase button, it throws the OnPurchaseFailed event with PurchaseFailureReason: DuplicateTransaction.

    So it only works if the user closes and opens the app again.
     
  7. JeffDUnity3D

    JeffDUnity3D

    Unity Technologies

    Joined:
    May 2, 2017
    Posts:
    14,446
    Yes, as you've stated. Please follow the recommendations.
     
Thread Status:
Not open for further replies.