Official IAP Trigger Events Not Working Dec 2015

0 favourites
  • 15 posts
From the Asset Store
Game Triggers is as versatile as a Swiss army knife, and will be a great resource for any type of game you're creating.
  • Hey Everyone,

    I am having a bit of trouble with the native IAP plugin which I hope one/some of you more experienced users will be able to help me with.

    Background

    I have created a simple game that I want to release with IAP’s to remove the Ads, pretty standard.

    I am using:

    • Construct 2 r218.

    • Official IAP plugin

    • Intel XDK (fully up to date on making this post)

    o Android InAppBilling (com.mcm.plugins.androidinappbilling)

    o Google Play Services for Android (com.google.playservices)

    o Phonegap Admob plugin (com.cranberrygame.phonegap.plugin.ad.admob)

    o Device (cordova-pligin-device)

    I have created a beta test app on google play and registered the in app purchase ID’s.

    When I publish the app in closed beta and install it on my phone the price of the IAP is not displayed, using Set text to “”&IAP.ProductPrice(“supportdev1”), and the On purchase success and the Has product “supportdev1” do not work.

    I have created text objects to monitor what is happening during game play on the phone and these events are never triggered, however I can purchase the product and the On store listing success is working.

    However, due to the triggers not working the ads are never removed. I have been stuck for 1.5 wks trying to sort this out and I believe I have read all the construct 2 tutorials and forum posts. So any help will be very must appreciated!

    You can see my logic below:

    On start of layout >> IAP > Add product IDs “supportdev1”

    >>IAP > Request store listing

    IAP > On store listing success >> Restore purchases

    >IAP > Has Product “supportdev1” >> System > Set IAP_Made to 1

    >> LocalStoreage > Set item “IAP_Made_Key” to IAP_Made

    IAP > On store listing success >> SupportDev1_Text > Set text to “”&IAP.ProductPice(“supportdev1”)

    >> Store_Available_Indicator_Text > Set Text to “Is Store Available: “&Display_IAP_Prices

    >> System > Set Display_IAP_Prices to “Yes”

    System > Display_IAP_Prices = “No” >> SupportDev1_Text > Set text to “…”

    Touch > On tap gesture on button >>

    IAP > Is store available >> IAP > Request store listing

    >> IAP > Purchase product “supportdev1”

    >> Purchase_Made_Indicator_Text > Set text to “IAP Made: “&IAP_Made

    On product “supportdev1” purchase success >> IAP > Restore purchases

    >> System > Set IAP_Made to 1

    >> LocalStorage > Get item “IAP_Made_Key”

    >> Purchase_Success_Indicator_Text > Set text to “Purchase Success”

    LocalStorage > On item “IAP_Made_Key” get >> LocalStorage > Set item ”IAP_Made_Key” to IAP_Made

    --------------------------------------------------------------------

    To see this all working in action checkout my game:

    https://play.google.com/store/apps/deta ... ubbaPoppin

  • *moved to a more appropriate location

  • Use release r218 and follow this tutorial. R218 contains a fix to the IAP C2 plugin.

    I'm still to update to the IAP part of the tutorial, but the cordova plugin to use for payments is : cc.fovea.cordova.purchase or https://github.com/poiuytrez/AndroidInAppBilling (as per my tests, both work)

    Be sure also to use the admob cordova plugin indicated in the tutorial.

    Prices and names still don't work currently (Ashley is looking into it) but "Has product" now triggers as expected.

    You don't need to request the store listing when doing a purchase since you already did it once on start of your application.

    So far I haven't used "Restore purchases" only used "Has product" and if it hasn't, then I'm displaying ads, otherwise, I'm hiding them, simple as that.

    Keep an eye on the tutorial I should update it quite soon and Ashley should make new versions of the IAP plugin as well.

  • Hey Kyatric,

    Thanks for the info, I'll take a look and report back

  • Update.

    My IAP are now working fine, I only needed to replace the "On purchase success" event with the "Has product" event and now it works. All of my other settings remain the same.

    I hope this post helps others, good luck guys and thank you for the help Kyatric

  • Moreover I've updated the tutorial I was talking about.

    It now contains a detailed part about IAPs.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Moreover I've updated the tutorial I was talking about.

    It now contains a detailed part about IAPs.

    You sir are a hero.

  • Kyatric

    What exactly is and isn't working in the IAP. This may be directly related to issues I'm having?

  • As far as I know ProductPrice and ProductName does not return values currently.

  • Thanks Kyatric, so does this mean that Has.Product "" doesn't respond properly? That's the issue I'm having. The user can purchase but when it checks for Has.Product it comes back false.

  • IAP.hasproduct("NameOfProduct") is working as intended if you are building using the latest beta version (r218) and having added the appropriate cordova plugin as described in the tutorial.

  • Thanks KYATRIC.

    I've got com.mcm.plugins.androidinappbilling which is the one you suggested in the tutorial and cc.fovea.plugins.inapppurchase which is in the .XML export. It works in the build but debug lines it out for some reason (XDK).

    Purchasing seems to work fine. The merchant account verifies the purchase. I just haven't figured out how to detect the purchase when the app is reloaded. I've been trying IAP.isStoreAvailable>>IAP.requestStoreListing & IAP.onStoreListingSuccess>>IAP.hasProduct. Success is being called but, hasProduct it comes back false every time.

    I've checked the spelling and case like a dozen times now. It's the same as the IAP.purchaseProduct

  • Don't add two cordova plugins, you only need one.

    If you want to use the one from cc.fovea, prefer using cc.fovea.cordova.purchase

    Always remember posting your code can get you quicker/more efficient answers as well.

  • Ya well, this thing has over 200 events and 1000+ actions.

    Here's what I was basing that on, the export to cordova's xdk additions.xml

    <intelxdk:plugin intelxdk:name="cc.fovea.plugins.inapppurchase" intelxdk:value="cc.fovea.plugins.inapppurchase" />

    <intelxdk:plugin intelxdk:name="com.mcm.plugins.androidinappbilling" intelxdk:value="https://github.com/maxmoore14/AndroidInAppBilling.git" />

    I'm pretty sure the fovea gets added in anyway because of the xml.

  • is there anyways for the new release? pleas help

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