Search Unity

  1. If you have experience with import & exporting custom (.unitypackage) packages, please help complete a survey (open until May 15, 2024).
    Dismiss Notice
  2. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice

[Solved] Unity IAP is not worked for android device

Discussion in 'Unity IAP' started by UnityAt2012, Oct 26, 2017.

?

Unity IAP is not worked for android device

  1. Unity IAP is not worked for android device

    1 vote(s)
    100.0%
  2. Unity IAP is not worked for android device

    1 vote(s)
    100.0%
Multiple votes are allowed.
Thread Status:
Not open for further replies.
  1. UnityAt2012

    UnityAt2012

    Joined:
    Oct 23, 2013
    Posts:
    5
    Hi, all

    my problem is that, i create a demo for testing unity IAP.
    i followed the unity document(https://docs.unity3d.com/Manual/UnityIAP.html) and the integrating blog(https://unity3d.com/cn/learn/tutorials/topics/ads-analytics/integrating-unity-iap-your-game) to add unity IAP services to my game.
    Also, I had done these things for testing on android device

    1. the demo is alive in google play with closing alpha test release
    2. Use SetPublicKey(googlePlayLicenseKey) interface set the correct google play license key
    3. Added the testers in google console both alpha release and settings.
    4. logined the tester gmail account in google app in my test android mobile device

    but, no google window pop ups and from log i can see that OnInitialized is called.
    below is the logs:


    10-30 21:35:56.851: E/Unity(31403): Unable to find AudioPluginOculusSpatializer
    10-30 21:35:56.852: E/Unity(31403): Unable to find libAudioPluginOculusSpatializer
    10-30 21:35:56.898: D/Unity(31403): GL_AMD_compressed_ATC_texture GL_AMD_performance_monitor GL_AMD_program_binary_Z400 GL_EXT_debug_label GL_EXT_debug_marker GL_EXT_discard_framebuffer GL_EXT_robustness GL_EXT_texture_format_BGRA8888 GL_EXT_texture_type_2_10_10_10_REV GL_NV_fence GL_OES_compressed_ETC1_RGB8_texture GL_OES_depth_texture GL_OES_depth24 GL_OES_EGL_image GL_OES_EGL_sync GL_OES_EGL_image_external GL_OES_element_index_uint GL_OES_fbo_render_mipmap GL_OES_fragment_precision_high GL_OES_get_program_binary GL_OES_packed_depth_stencil GL_OES_depth_texture_cube_map GL_OES_rgb8_rgba8 GL_OES_standard_derivatives GL_OES_texture_3D GL_OES_texture_float GL_OES_texture_half_float GL_OES_texture_half_float_linear GL_OES_texture_npot GL_OES_vertex_half_float GL_OES_vertex_type_10_10_10_2 GL_OES_vertex_array_object GL_QCOM_alpha_test GL_QCOM_binning_control GL_QCOM_driver_control GL_QCOM_perfmon_global_mode GL_QCOM_extended_get GL_QCOM_extended_get2 GL_QCOM_tiled_rendering GL_QCOM_writeonly_rendering GL_EXT_sRGB GL_EXT_sRGB_write_control GL_EXT_
    10-30 21:35:56.899: D/Unity(31403): texture_sRGB_decode GL_EXT_texture_filter_anisotropic GL_EXT_multisampled_render_to_texture GL_EXT_color_buffer_float GL_EXT_color_buffer_half_float GL_EXT_disjoint_timer_query
    10-30 21:36:01.485: I/Unity(31403): UnityIAP StandardPurchasingModule Version: 1.14.1
    10-30 21:36:01.485: I/Unity(31403):
    10-30 21:36:01.485: I/Unity(31403): (Filename: ./artifacts/generated/common/runtime/DebugBindings.gen.cpp Line: 51)
    10-30 21:36:01.712: I/UnityIAP(31403): IAB helper created.
    10-30 21:36:02.013: I/UnityIAP(31403): Starting in-app billing setup.
    10-30 21:36:02.035: I/UnityIAP(31403): Billing service connected.
    10-30 21:36:02.037: I/UnityIAP(31403): invoking callback
    10-30 21:36:02.037: I/UnityIAP(31403): Checking for in-app billing 3 support.
    10-30 21:36:02.041: I/UnityIAP(31403): In-app billing version 3 supported for com.flyergames.shooter
    10-30 21:36:02.046: I/UnityIAP(31403): Subscriptions AVAILABLE.
    10-30 21:36:02.053: I/UnityIAP(31403): VR supported.
    10-30 21:36:02.053: I/UnityIAP(31403): onIabSetupFinished: 0
    10-30 21:36:02.053: I/UnityIAP(31403): Requesting 1 products
    10-30 21:36:02.053: I/UnityIAP(31403): QueryInventory: 1
    10-30 21:36:02.054: I/UnityIAP(31403): invoking callback
    10-30 21:36:02.054: I/UnityIAP(31403): Querying owned items, item type: inapp
    10-30 21:36:02.054: I/UnityIAP(31403): Package name: com.flyergames.shooter
    10-30 21:36:02.054: I/UnityIAP(31403): Calling getPurchases with continuation token: null
    10-30 21:36:02.059: I/UnityIAP(31403): Owned items response: 0
    10-30 21:36:02.060: I/UnityIAP(31403): Continuation token: null
    10-30 21:36:02.060: I/UnityIAP(31403): Querying SKU details.
    10-30 21:36:02.072: I/UnityIAP(31403): Querying owned items, item type: subs
    10-30 21:36:02.072: I/UnityIAP(31403): Package name: com.flyergames.shooter
    10-30 21:36:02.072: I/UnityIAP(31403): Calling getPurchases with continuation token: null
    10-30 21:36:02.078: I/UnityIAP(31403): Owned items response: 0
    10-30 21:36:02.078: I/UnityIAP(31403): Continuation token: null
    10-30 21:36:02.078: I/UnityIAP(31403): Querying SKU details.
    10-30 21:36:02.092: I/UnityIAP(31403): onQueryInventoryFinished: true
    10-30 21:36:02.092: I/UnityIAP(31403): Inventory refresh successful. (response: 0:OK)
    10-30 21:36:02.579: I/Unity(31403): OnInitialized: PASS
    10-30 21:36:02.579: I/Unity(31403):
    10-30 21:36:02.579: I/Unity(31403): (Filename: ./artifacts/generated/common/runtime/DebugBindings.gen.cpp Line: 51)
    10-30 21:36:28.318: I/Unity(31403): Purchasing product asychronously: 'gold50'
    10-30 21:36:28.318: I/Unity(31403):
    10-30 21:36:28.318: I/Unity(31403): (Filename: ./artifacts/generated/common/runtime/DebugBindings.gen.cpp Line: 51)
    10-30 21:36:28.320: I/UnityIAP(31403): isUnityVrEnabled = false
    10-30 21:36:28.321: I/UnityIAP(31403): onPurchaseProduct: gold50
    10-30 21:36:28.321: I/UnityIAP(31403): ITEM TYPE:inapp
    10-30 21:36:28.345: I/Unity(31403): purchase({0}): gold50
    10-30 21:36:28.345: I/Unity(31403):
    10-30 21:36:28.345: I/Unity(31403): (Filename: ./artifacts/generated/common/runtime/DebugBindings.gen.cpp Line: 51)
    10-30 21:36:28.388: I/UnityIAP(31403): Creating purchase activity
    10-30 21:36:28.389: I/UnityIAP(31403): invoking callback
    10-30 21:36:28.389: I/UnityIAP(31403): Constructing buy intent for gold50, item type: inapp
    10-30 21:36:28.407: I/UnityIAP(31403): Launching buy intent for gold50. Request code: 999
    10-30 21:36:28.434: I/UnityIAP(31403): onActivityResult
    10-30 21:36:28.435: I/UnityIAP(31403): onIabPurchaseFinished: false
    10-30 21:36:28.435: I/UnityIAP(31403): Null data in IAB result (response: -1002:Bad response received)
    10-30 21:36:28.435: I/UnityIAP(31403): Purchase response code:-1002
    10-30 21:36:28.435: I/UnityIAP(31403): Received bad response, polling for successful purchases to investigate failure more deeply
    10-30 21:36:28.435: I/UnityIAP(31403): invoking callback
    10-30 21:36:28.435: I/UnityIAP(31403): Querying owned items, item type: inapp
    10-30 21:36:28.435: I/UnityIAP(31403): Package name: com.flyergames.shooter
    10-30 21:36:28.435: I/UnityIAP(31403): Calling getPurchases with continuation token: null
    10-30 21:36:28.440: I/UnityIAP(31403): Owned items response: 0
    10-30 21:36:28.440: I/UnityIAP(31403): Continuation token: null
    10-30 21:36:28.493: I/Unity(31403): onPurchaseFailedEvent({0}): gold50
    10-30 21:36:28.493: I/Unity(31403):
    10-30 21:36:28.493: I/Unity(31403): (Filename: ./artifacts/generated/common/runtime/DebugBindings.gen.cpp Line: 51)
    10-30 21:36:28.508: I/Unity(31403): OnPurchaseFailed: FAIL. Product: 'gold50', PurchaseFailureReason: Unknown
    10-30 21:36:28.508: I/Unity(31403):
    10-30 21:36:28.508: I/Unity(31403): (Filename: ./artifacts/generated/common/runtime/DebugBindings.gen.cpp Line: 51)
     

    Attached Files:

  2. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    You also created your products on your Google dashboard , specifically gold50 ? Did you create it as Consumable or Non-Consumable?
     
  3. UnityAt2012

    UnityAt2012

    Joined:
    Oct 23, 2013
    Posts:
    5
    Thanks for you reply. Yes, I created my products, specifically gold50. And maybe google dashboard changed its version as i can't find where to change product type to Consumable or Non-Consumable. In code, i tested gold50 as consumable and noncomsuable, but all didn't work.
    Below is my screenshot of my products in google dashboard.

    upload_2017-10-27_9-51-18.png
    In addition, the apk installed on my test android device has the same vercode and signing with the closed alpha release apk.
    With the snapshot of error below:
    upload_2017-10-27_10-0-14.png
    have any suggestion what to do now?
     
    Last edited: Oct 27, 2017
  4. UnityAt2012

    UnityAt2012

    Joined:
    Oct 23, 2013
    Posts:
    5
    In addtion, i also tested other two products(consumable and nonconsumable), but it also didn't work on my test device with tester account.
     
  5. UnityAt2012

    UnityAt2012

    Joined:
    Oct 23, 2013
    Posts:
    5
    Has it related to the google merchant account setting , as i found my sale tex info is not set in canada and united states.
    upload_2017-10-27_10-35-24.png
     
  6. UnityAt2012

    UnityAt2012

    Joined:
    Oct 23, 2013
    Posts:
    5
    It has been resolved!
    In order to prevent some people encounter the same problem, I talk about how I solved.

    1. First make sure you called IGOoglePlayConfiguration's SetPublicKey interface to set google play public key correct.
    2. I changed my test android device, first i used Mi phones, it didn't work and even did not pop up google charge window, later changed to nexus, then google pop showed when purchased, but had error showed can't perchase this item(my device system is chinese, so maybe this error info is not original)
    3. The error in pop window was solved by this(https://stackoverflow.com/questions...lling-the-publisher-cannot-purchase-this-item) . Below is the important info to solve my problem.
    upload_2017-10-27_15-22-47.png
    my nexus device had several google accounts, only one was in my tester list, and the test account was the last one, so it was failed.
     
    PKillerio and ap-unity like this.
Thread Status:
Not open for further replies.