Construct 3 In App Purchase not working

  • Okay good to know, this is the test app I use https://www.dropbox.com/s/wy9nfmi1fnk6nlj/Purchase%20Demo.c3p?dl=0. It should work fine on Android and iOS.

    The "Purchasing product [...]" log is where the JS code asks the plugin to start the purchase, so it hasn't made it as far as the native code yet.

  • Thanks, I'll review the demo now and let you know if I discover any mistakes on my end.

    Cheers for now.

  • If that doesn't work out it would be useful if you could create a bug report for this, it'll make it easier to track down whats going wrong here. https://github.com/Scirra/Construct-3-bugs/issues. Please provide a minimal project, based on your actual purchase flow code and replication steps on how you building your project. I would appreciate it if you gave a detailed but concise report. Trying to debug an in app purchase will take quite a chunk of my time, so I want to make sure I'm doing exactly what your doing. I'll try my hardest to get this sorted out for you. I can appreciate that testing these things can be fairly tedious / frustrating.

    If you do figure out what's wrong in the mean time, then also let me know so I can either put a note in the manual or sure up the code in that area.

  • Thanks, I appreciate the attention.

    I'm using the export for Xcode settings, is there anything inside of Xcode that needs to be activated?

    For Android, I'm building as unsigned release, then jar signing and aligning.

    Both of the apps exhibit the same outcome: IAP dialog not showing, but stating that it should.

    Again, I'll have a review of your Purchase Demo and double check it's all correct, and let you know.

  • Hi Nepeo, finally got to testing this app. When I test it from XCode it simply crashes now. Which is a step forward I suppose! The error log shows a problem.

    I wonder if this is because I'm running from XCode and not from the 'official app' from Itunes. I'll publish it and see what happens.

    Here's the log that is crashing though:

    018-01-24 23:22:10.402366-0500 Star Lords Empires of a New Dawn[2171:1077879] [C2 CORDOVAIAP] Registering product "iap_mythril_5000"

    2018-01-24 23:22:10.403226-0500 Star Lords Empires of a New Dawn[2171:1077879] [C2 CORDOVAIAP] Registering product "iap_mythril_15000"

    2018-01-24 23:22:10.403393-0500 Star Lords Empires of a New Dawn[2171:1077879] [C2 CORDOVAIAP] Registering product "iap_mythril_50000"

    2018-01-24 23:22:11.075326-0500 Star Lords Empires of a New Dawn[2171:1077879] THREAD WARNING: ['InAppPurchase'] took '12.457275' ms. Plugin should use a background thread.

    2018-01-24 23:22:12.537187-0500 Star Lords Empires of a New Dawn[2171:1077879] [C2 CORDOVAIAP] store ready

    2018-01-24 23:22:25.302889-0500 Star Lords Empires of a New Dawn[2171:1077879] [C2 CORDOVAIAP] Purchasing product "iap_mythril_15000"

    2018-01-24 23:22:25.308049-0500 Star Lords Empires of a New Dawn[2171:1077879] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'Invalid product identifier: (null)'

    *** First throw call stack:

    (0x18641a364 0x185660528 0x18641a2ac 0x199886a98 0x100ac571c 0x100afcc24 0x100ad349c 0x100ad48c8 0x1957a7130 0x19573ba30 0x19573dc10 0x195528148 0x195705800 0x1954e874c 0x1954eb140 0x18d708d38 0x18d708ff8 0x1863c297c 0x1863c28fc 0x1863c2184 0x1863bfd5c 0x1862dfe58 0x18818cf84 0x18f95f67c 0x100ac3c34 0x185dfc56c)

    libc++abi.dylib: terminating with uncaught exception of type NSException

    (lldb)

  • By the looks of the error it's actually trying to make a purchase now, but is failing with an invalid product ID. I had a quick look online and this error seems to cover a multitude of configuration issues...

    Have a look through these and see how you get on http://troybrant.net/blog/2010/01/invalid-product-ids/. Some are complicated looking, so just start with the easiest ones.

    One that stood out to me was that you had to use xcode to load the app onto the device, and you had to make sure to remove any old versions of the app from the device first.

  • Thanks for the heads up, I’ll give your suggestions a shot tonight and check back in this weekend

  • Sorry for the delay in communications -- but my app simply just crashes when trying to use the in app purchase.

    You can try the app for yourself:

    IOS: https://itunes.apple.com/us/app/star-lo ... ?ls=1&mt=8

    ANDROID: https://play.google.com/store/apps/deta ... rlords.sle

  • What is the exact error message you get? It's hard to help without more information. Tagging Nepeo

  • Hi Ashley,

    I have setup the IAP object here:

    And press a button to start the purchase:

    The application then crashes back to home screen. XCode has the following:

    2018-01-24 23:22:25.308049-0500 Star Lords Empires of a New Dawn[2171:1077879] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'Invalid product identifier: (null)'
    
    *** First throw call stack:
    
    (0x18641a364 0x185660528 0x18641a2ac 0x199886a98 0x100ac571c 0x100afcc24 0x100ad349c 0x100ad48c8 0x1957a7130 0x19573ba30 0x19573dc10 0x195528148 0x195705800 0x1954e874c 0x1954eb140 0x18d708d38 0x18d708ff8 0x1863c297c 0x1863c28fc 0x1863c2184 0x1863bfd5c 0x1862dfe58 0x18818cf84 0x18f95f67c 0x100ac3c34 0x185dfc56c)
    
    libc++abi.dylib: terminating with uncaught exception of type NSException
    
    (lldb)
    [/code:zwzemm0l]
    
    You can try the app for yourself:
    
    IOS: [url]https://itunes.apple.com/us/app/star-lords-empire/id1329783341?ls=1&mt=8[/url]
    ANDROID: [url]https://play.google.com/store/apps/details?id=com.starlords.sle[/url]
  • Nepeo is the developer who made the IAP plugin, best to tag them instead.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Hey! I found an article on Google when I google for the error message:

    Invalid product identifier IOS

    https://stackoverflow.com/questions/419 ... p-purchase

    I double checked my Itunes Connect account, and my banking information didn't go through correctly. I have updated that information, it is now processing.

    HOPEFULLY this clears up the issue! I'll keep you all posted. Jeeze you'd think they're return a better message than NULL, but I suppose it makes sense; without the tax/bank information the IAP products aren't live, so they're NULL.

    Hopefully...

  • IT'S WORKING!

    After finishing up my Itunes Connect tax information, about 1 hour later I tried my IAP purchase again.

    It works!

    I think the error messages are pretty... uninformative. But I suppose it makes sense when you look at it in hindsight.

    Too bad the folks at Scirra weren't more helpful, but hopefully this forum post will be a good reference in the future...

  • Too bad the folks at Scirra weren't more helpful, but hopefully this forum post will be a good reference in the future...

    Ashley and Nepeo both spent time to reply on your posts and give suggestions. To me that is quite helpful.

    Anyway, thanks for letting us know it works now.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)