Search Unity

In app purchase initializing but not showing pop up window on mobile device

Discussion in 'Unity IAP' started by Kay86X, Jul 5, 2019.

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

    Kay86X

    Joined:
    May 9, 2017
    Posts:
    10
    Hello Anyone,

    Implemented Unity IAP in my mobile game, and it worked in the editor but upon finishing and rolling out to closed testing on Android, in initializes successfully but when i click to purchase, it shows nothing. I checked using the Android Studio logcat and detected this error (Something relating to VR, which i'm not even using).

    Note: I'm using Unity 2018.3 and the most recent Unity IAP

    Code (CSharp):
    1. 07-05 09:18:32.215 21710-21724/? I/Unity: Purchasing product asychronously: 'icoin_pack2'
    2.                                           Purchaser:BuyProductID(String)
    3.                                           UnityEngine.Events.UnityEvent:Invoke()
    4.                                           UnityEngine.EventSystems.StandaloneInputModule:ProcessTouchPress(PointerEventData, Boolean, Boolean)
    5.                                           UnityEngine.EventSystems.StandaloneInputModule:ProcessTouchEvents()
    6.                                           UnityEngine.EventSystems.StandaloneInputModule:Process()
    7.                                          
    8.                                           (Filename: ./Runtime/Export/Debug.bindings.h Line: 45)
    9. 07-05 09:18:32.238 21710-21724/? E/Unity: Exception: Error: called non-existent method System.Boolean UnityEngine.VR.VRSettings::get_enabled()
    10.                                             at UnityEngine.VR.VRSettings.get_enabled () [0x00000] in <00000000000000000000000000000000>:0
    11.                                             at UnityEngine.Purchasing.GooglePlayAndroidJavaStore.Purchase (System.String productJSON, System.String developerPayload) [0x00000] in <00000000000000000000000000000000>:0
    12.                                             at UnityEngine.Purchasing.JSONStore.Purchase (UnityEngine.Purchasing.ProductDefinition product, System.String developerPayload) [0x00000] in <00000000000000000000000000000000>:0
    13.                                             at UnityEngine.Purchasing.PurchasingManager.InitiatePurchase (UnityEngine.Purchasing.Product product, System.String developerPayload) [0x00000] in <00000000000000000000000000000000>:0
    14.                                             at UnityEngine.Events.UnityEvent.Invoke () [0x00000] in <00000000000000000000000000000000>:0
    15.                                             at UnityEngine.EventSystems.StandaloneInputModule.ProcessTouchPress (UnityEngine.EventSystems.PointerEventData pointerEvent, System.Boolean pressed, System.Boolean released) [0x00000]
    16.  
     
  2. Schmit

    Schmit

    Joined:
    Apr 1, 2015
    Posts:
    4
    Same frustrating issue here. After reading through this thread the suggestions are to update Unity to 2019.3 alpha, 2019.2b5, or 2019.1.6f1 and "use a project path without spaces".

    This response by Unity staff also says to use 1.22 from the asset store (instead of the services window).

    I'm literally going through these steps now to see if I can IAPs to work, however there's also mention that IL2CPP may snag issues (required for 64-bit builds).
     
  3. Schmit

    Schmit

    Joined:
    Apr 1, 2015
    Posts:
    4
    These steps appeared to work for me, though I'm not really sure which caused the fix:

    • Update to 2019.1.9f1 (Include the Android NDK for 64-bit builds)
    • Create a new project with no spaces in the path
    • Use the service window to "link" the desired project
    • Enable in-app purchasing in the service window (but don't "Import" from this window)
    • Open the app store and search for Unity IAP, download and import 1.22
    • Several prompts about updating libraries should occur, and then IAPs should be available in the project (Window -> Unity IAP)
    • Replace the plugins UDP, UnityChannel, and UnityPurchasing from the new project to the desired project
    • Open the desired project in Unity 2019.1.9f1
    • From the package manager, make sure "in-app purchasing 2.0.6" is included
    • Build, sign, and upload.
    As a side note, there are some good tips for testing Google Play in-app purchases before distributing to an alpha/beta channel. Primarily, these two were helpful while working through these IAP oddities:
    • side-load a signed apk directly to the device
    • set up test purchases for accounts from the Google Play Console (License Testing).
    I hope you have similar luck!
     
  4. Kay86X

    Kay86X

    Joined:
    May 9, 2017
    Posts:
    10
    Thanks Schmit! I followed similar steps but i didn't use unity 2019...

    > Backed up the files first
    > Deleted UDP, UnityChannel, and UnityPurchasing folders
    > I created a new project
    > Activated Unity IAP in it
    > Updated the IAP package from asset store in the new project
    > Ran the API updater, to update the imported codes (Apparently the issue is triggered as a result of obsolete code, details in this link: https://forum.unity.com/threads/exc...unityengine-vr-vrsettings-get_enabled.518868/)
    > Then I copied the UDP, UnityChannel, and UnityPurchasing folders from the new project into the original project

    And it solved the issue!!
     
    WhiskyandGunpowder likes this.
  5. renars_s

    renars_s

    Joined:
    Nov 13, 2019
    Posts:
    2
    Check if your google plays store Product ID name is Lower Case Then check if that Product ID is the same in your IAP script and unity Inspector window.
    BOTH must be LOWER CASE.

    Failure can occur because in editor unity does not check productID in google console.
    When testing on mobile phone if product ID values do not match those in google console, then it shows nothing.
     
  6. John_Corbett

    John_Corbett

    Joined:
    May 17, 2019
    Posts:
    151
    Hello!

    Sorry for the inconvenience, but the most recent IAP is only supported on Unity version 2018.4f18 or newer. Sadly there's no easy way for us to control this on the Asset Store side.

    In any case, glad you have solved your issues.

    Also, it's true that we're not able to sync anything from Google Console at this time. Good point about everything needing to be in lower case, this is a known issue.
     
Thread Status:
Not open for further replies.