Search Unity

  1. Unity 2019.2 is now released.
    Dismiss Notice

Unity Codeless IAP - Purchase failed because Purchasing was not initialized correctly (iOS only)

Discussion in 'Unity IAP' started by Jimbo_Slice, Jun 23, 2019.

  1. Jimbo_Slice

    Jimbo_Slice

    Joined:
    Oct 1, 2015
    Posts:
    29
    Hi everyone,

    I would appreciate a bit of help. I have been stuck on this for days and it is really frustrating me. I feel like I have exhausted all the tutorials, docs, YouTube videos etc. so maybe someone has some first-hand experience that can help me out?

    I have one simple IAP in my mobile game implemented using Codeless IAP (version 1.22.0 with Unity 2019.1.0f2) - to remove ads. It works fine in the Editor and flawlessly on Android (it has actually been approved for publication on Google Play but this App Store release is delaying the launch).

    Things that I have done so far:

    - In-App Purchase has been added on App Store Connect and its status is 'Ready for Submission'. Can someone clarify... the ID for my IAP is "remove_adverts" in the IAP Catalog, should this be the same on the App Store or should I add the bundle identifier as well? e.g. com.CompanyName.AppName.remove_adverts

    - EDIT: All my Banking & Tax settings are set up and approved on App Store Connect

    - Ensured that my Purchasing script is attached to an empty GameObject that is never disabled etc. so it should initialize

    - In Unity IAP Catalog have ensured Apple SKU and Apple Team ID are the same as App Store Connect. Have also ensured everything is synced to UDP. Automatically initialise UnityPurchasing is set to true

    - Ensured that In-App Purchasing Capability is enabled in Xcode

    - Enabled StoreKit.framework in Xcode

    - Archived and Uploaded to App Store Connect through Xcode

    - Invited my Apple developer account to test the app through Test Flight. Is it problematic that the test account is the same as the developer account?

    Then when I install the app through TestFlight and run it I press the IAP button and nothing happens.

    My Device Log displays the following...




    Purchase failed because Purchasing was not initialized correctly

    UnityEngine.Purchasing.CodelessIAPStoreListener:InitiatePurchase(String)

    UnityEngine.Events.UnityAction:Invoke()

    UnityEngine.Events.UnityEvent:Invoke()

    UnityEngine.EventSystems.EventFunction`1:Invoke(T1, BaseEventData)

    UnityEngine.EventSystems.ExecuteEvents:Execute(GameObject, BaseEventData, EventFunction`1)

    UnityEngine.EventSystems.StandaloneInputModule:processTouchPress(PointerEventData, Boolean, Boolean)

    UnityEngine.EventSystems.StandaloneInputModule:processTouchEvents()

    UnityEngine.EventSystems.StandaloneInputModule:process()



    (Filename: ./Runtime/Export/Debug/Debug.bindings.h Line: 48)




    Any help would be greatly appreciated!

    J
     
    Last edited: Jun 23, 2019
  2. Jimbo_Slice

    Jimbo_Slice

    Joined:
    Oct 1, 2015
    Posts:
    29
    Just tried downgrading to Unity Codeless IaP 1.20 and the problem remains the same
     
  3. JeffDUnity3D

    JeffDUnity3D

    Unity Technologies

    Joined:
    May 2, 2017
    Posts:
    4,855
    Please compare your implementation to the sample IAP projects here. The first is scripted (my preference) and the second project is Codeless. The productIDs need to be the same, please show a screenshot of your IAP Catalog list, and the IAP as defined on Apple. https://forum.unity.com/threads/sample-iap-project.529555/ I might suggest to add Debug.Log statements in your code, they will show up when doing local iOS device testing . Make sure you have also hooked up the Purchase Failure event in your IAP button.
     
  4. Jimbo_Slice

    Jimbo_Slice

    Joined:
    Oct 1, 2015
    Posts:
    29
    So I am ashamed to say the issue was down to my human error :(

    Thanks for your reply Jeff
     
  5. kartoonist435

    kartoonist435

    Joined:
    Feb 14, 2015
    Posts:
    21
    What was your error? I'm having the same problem.