How do I configure the IAP plugin in a cordova project?

0 favourites
  • 4 posts
From the Asset Store
With this template you can create your own archer game and customize it however you want.
  • I'm using newer versions of cordova and c2 to build my game, i'm doing some tests with the IAP plugin but can't get it working, how i build it:

    export the project as a cordova app and dismark the options to export to XDK.

    so in cordova i do: cordova plugin add cordova-plugin-payment-iap(this is from here: github.com/cranberrygame/cordov ... ayment-iap Github)

    the plugin is installed and the build runs ok.

    Note: i also tried to build without the plugin but the app behaviour was the same.

    This is my project:

    on start of layout: add product ID "test_pd" and request store listing
    on store listing succes: text "ok"
    on store listing failed: text "not ok"
    on button clicled: purchase produtct "test_pd"
    on any purchase success: text "purchased"
    [/code:22tw5dz3]
    The problem is: no message is being displayed, it should at least try to download the store(i have no idea from where!!??) and show me a "not ok" message, but nothing is happening, i guess the plugin is not working, so can someone please explain me where can i get the right plugin for the IAP in C2 and the right way to configure it?
    
    Thanks for attention.
  • Someone?

  • Ok, i figured out! The problem is that when exporting to cordova only we have to manually configure the plugins we are using(intel XDK do it for us) , because some plugins uses 3rd party dependencies to do their job, this dependencies are listed in the edittime.js file of the plugin, so, for each plugin you use you must install the cordova plugins to make them run, in this cases they are just bridges between c2 and cordova.

    After that i finally got an "not ok" message, thanks all for attention and sereously i think that this kind of thing should be made more clear, it would save us a lot of time...

    Thanks all for attention.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Hello Paulo, sorry for my English. I would write in Portuñol but I think that the rules of the forum in English do not allow it.

    I have the same problem that you had using iap and cordova.

    I do not finish understanding that you added in "edittime.js"

    Could you comment what line you have modified?

    Thank you!

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