Search Unity

[Closed] IAP Work Fine In Development But Crash In Production

Discussion in 'Unity IAP' started by SevenAdmin, Mar 17, 2017.

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

    SevenAdmin

    Joined:
    Jul 7, 2014
    Posts:
    7
    Heya everyone. We published the first version of our app that uses IAP to let people subscribe this morning. Even with testflight tests and whatnot, it seems that the app crashes as soon as it gets to initializing the IAP. We've pretty extensively tinkered around the Purchaser.cs file, but like I said, it works well in development/testflight/xcode builds.

    Is there something special we have to change between this version and the one we want to sell? Our IAPs are approved and ready for sell on iTunes Connect and we have already filled all the tax-related forms, so I think we're covered on that end.

    Seeing as it never gets in the OnInitialized() function (nor the OnInitializeFailed one) we're a bit confused about what could be the problem.

    We're on unity 5.5.0f3 with the IAP version 1.9.2

    We're targetting iOS for now.

    Thanks!
     

    Attached Files:

  2. SevenAdmin

    SevenAdmin

    Joined:
    Jul 7, 2014
    Posts:
    7
    Just to keep this updated; now the app does not crash, but it doesn't seem to either get into the OnPurchaseFailed or ProcessPurchase while in live appstore builds. That being said, it works on testflight/internal test builds.
     
  3. ap-unity

    ap-unity

    Unity Technologies

    Joined:
    Aug 3, 2016
    Posts:
    1,519
    @SevenAdmin,

    Taking a look at your purchase script, the one thing that jumps out at me is this function:
    Code (CSharp):
    1. public void BuySubscription()
    2. {
    3.     ...
    4.     BuyProductID(kProductIDSubscription);
    5.     StartCoroutine (WaitForSubscription ());
    6. }
    This code is calling two functions BuyProductID which initiates the purchase asynchronously and the WaitForSubscription coroutine which loads a new scene when a subscription is detected. Since this purchasing script is a monobehaviour, it will be destroyed when a new scene is loaded.

    Could you try using DontDestroyOnLoad with your Purchasing script and see if that helps this situation?
    https://docs.unity3d.com/ScriptReference/Object.DontDestroyOnLoad.html
     
Thread Status:
Not open for further replies.