Search Unity

[Closed] One code base 2 game identifiers problem

Discussion in 'Unity IAP' started by arkon, Jan 23, 2018.

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

    arkon

    Joined:
    Jun 27, 2011
    Posts:
    1,122
    Hi,

    All my games have a paid full version and a free version. Both have in app purchases in them.
    both versions are the exact same unity project. All I do between paid and free is change the Game
    ID com.xxxxx.xxxxx to com.xxxx.xxxxFree, change the name in the project name field. Change the icon and set a bool in the game to say it's free or not.

    I've used Prime31 for all my games so far but just swapped one over to unity IAP services. followed all the instructions and published the free version and it all works great with unity IAP.

    BUT mow I've come to release the full version and IAP doesn't connect to the store. How do I handle
    1 code base but with 2 game ID's with Unity IAP service? (Please don't say I have to create a new project for each version!)
     
  2. ap-unity

    ap-unity

    Unity Technologies

    Joined:
    Aug 3, 2016
    Posts:
    1,519
  3. arkon

    arkon

    Joined:
    Jun 27, 2011
    Posts:
    1,122
    Ok, The iPad is using a developer iTunes store sandbox credentials for testing IAP. The log messages I'm getting are (Redacted):-

    Code (CSharp):
    1. UnityIAP StandardPurchasingModule Version: 1.15.0
    2. UnityEngine.Purchasing.StandardPurchasingModule:Instance(AppStore)
    3. Purchaser:InitializePurchasing()
    4. Purchaser:Start()
    5.  
    6. (Filename: /Users/builduser/buildslave/unity/build/artifacts/generated/common/runtime/DebugBindings.gen.cpp Line: 51)
    7. 2018-01-24 10:51:47.390823+1100 GameName[5926:6811079] UnityIAP:Requesting 2 products
    8. QED 14 OnInitialized: PASS

    (The iAp system initialised fine and got the products and stored the prices)
    Then when I press on a purchase button this happens:

    Code (CSharp):
    1. QED 26 Purchasing product asychronously: 'XX_XXXXX'
    2. 2018-01-24 10:56:36.651587+1100 GameName[5926:6811079] UnityIAP:purchaseProduct: XX_XXXXX
    3. 2018-01-24 10:56:36.665242+1100 GameName[5926:6811079] UnityIAP:UpdatedTransactions
    4. purchase({0}): XX_XXXXX
    5. EventDelegate:Execute()
    6. EventDelegate:Execute(List`1)
    7. (Filename: /Users/builduser/buildslave/unity/build/artifacts/generated/common/runtime/DebugBindings.gen.cpp Line: 51)
    8. -> applicationWillResignActive()
    9. -> applicationDidBecomeActive()
    10. -> applicationWillResignActive()
    11. 2018-01-24 10:56:40.818656+1100 GameName[5926:6811079] [App] if we're in the real pre-commit handler we can't actually add any new fences due to CA restriction
    12. -> applicationDidBecomeActive()
    13. 2018-01-24 10:57:22.554457+1100 GameName[5926:6811079] UnityIAP:UpdatedTransactions
    14. 2018-01-24 10:57:22.554558+1100 GameName[5926:6811079] UnityIAP:purchaseFailed: 0
    15. onPurchaseFailedEvent({0}): XX_XXXXX
    16. UnityEngine.Purchasing.PurchasingManager:OnPurchaseFailed(PurchaseFailureDescription)
    17. UnityEngine.Purchasing.Extension.UnityUtil:Update()
    18. (Filename: /Users/builduser/buildslave/unity/build/artifacts/generated/common/runtime/DebugBindings.gen.cpp Line: 51)
    19. QED 27 OnPurchaseFailed: FAIL. Product: 'XX_XXXXX', PurchaseFailureReason: Unknown
    20. -> applicationWillResignActive()
    So not much in the way of a reason given. Like I say 2 identical programs where the shop is involved. One works the other doesn't, The only difference is the game ID.

    This is getting really frustrating really fast. When I first enabled the IAP service in the free version of the game it set up a game ID etc on your services portal. But as it's the same code It uses the same game ID on the IAP dashboard.

    Should I duplicate the project and set up IAP again to get a different entity on the Dashboard?
     
    Last edited: Jan 24, 2018
  4. arkon

    arkon

    Joined:
    Jun 27, 2011
    Posts:
    1,122
    Ok, I duplicated the project so I could get a new game ID from Unity IAP Services for it. Still doesn't work. Same error of Unknown error when I try and purchase something. All IAP ids are correct, all signed correctly. Seems to initialise ok as it gets the prices of the items from the store. Just fails to purchase anything. All works fine with the Prime 31 plugin so this is why I think the problem is at the unity services end.
     
  5. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    @arkon We are actively discussing this issue with the IAP team here. Might you have disabled any products in iTunesConnect by chance? We are aware of an issue where we see behavior similar to yours, when a product has been disabled.
     
  6. arkon

    arkon

    Joined:
    Jun 27, 2011
    Posts:
    1,122
    No all enabled correctly. Like I say if I use the previous version of the game that's already on the store it work fine with the 3rd party plugin doing the transaction. I did notice last night in the Unity Dashboard for this new version of the game it was marked as "Incomplete integration"
     
  7. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    So it's working with the other plugin with both versions, the paid and free? Just checking. The "Incomplete integration" message would not be relevant here, it's part of the Analytics integration. I would encourage you to open a support ticket so that we may investigate further. We would be asking for your full logs if possible. We are anxious to assist. You can open a support ticket here: https://analytics.cloud.unity3d.com/support
     
  8. arkon

    arkon

    Joined:
    Jun 27, 2011
    Posts:
    1,122
    That was frustrating. I was just creating logs etc from both version to send you in a support ticket and today the broken version has started working correctly! Are you absolutely sure the "incomplete integration" message has no effect because the only thing I've done different was go to your dashboard and keep clicking next on the integration tab until the message changed to something like integration progressing or something like that. Anyway I'm going to submit it to the store and see if it still works after that.

    So just to recap and help your IAP team. One code base, one unity project. Two com.companyname.product ID's On for a free version with IAP and one for a paid version with 2 iAP products in it. The only difference in the code execution is the Paid version uses a different Product ID to the Free Version. Both versions initialised the purchaser correctly and passed. Both versions received the price for the IAP items thus confirming the iTunes store connection.
    The Free version purchases correctly and I get the purchase successful call and the Paid version gets the failed function call with the reason unknown error.

    If you need anything else to help you feel free to ask, but its working this morning, no idea why. I changed nothing at any end except the integration tab in the Dashboard to make the "incomplete integration" message go away.
     
  9. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    In discussing with the team here, our suspicion is something on the Apple side. Analytics Integration only applies to viewing events on the Dashboard. Integration is not considered complete until the developer has visited the Dashboard at least once and is a UI process only. And it would not explain why the free version behaved differently from the paid version, when the integration message was still displaying. It is likely not relevant here and is a coincidence. But glad it is working for you now!
     
  10. arkon

    arkon

    Joined:
    Jun 27, 2011
    Posts:
    1,122
    Guys, It's doing it again this time with the Mac store version! So I suspect it will happen again when I create the Android version too. I really need some guidance on the correct way of creating 1 unity project that targets 6 different versions. IOS paid and free versions, MacOS paid and free versions, Android Paid and free versions.

    I suppose my question is, am I supposed to use the services tab to unlink the game and then create a new link for each and every version? I initially thought it needed just 1 game ID in the Dashboard and all 6 variants would send their IAP product ids to the same entry in Dashboard. Whatever happens I can't keep copying the unity project directory to create 6 seperate projects for the same game, that will quickly become a nightmare to maintain.
     
  11. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    Apple can take up to a few days for submissions to be fully able to test. I suspect this is what you saw last time also. The Android release process is separate from the Apple release process, and is generally quite fast. In my experience, apps are ready in Alpha/Beta release in less than an hour, please let us know how it is working for you.
     
Thread Status:
Not open for further replies.