How do I check if user has product (IAP android)?

0 favourites
  • 7 posts
From the Asset Store
a ready made template of Mobile Advert, Google Play and Mobile IAP Plugin,
  • Hi, I'm using Cranberry's Cordova IAP plugin for c2 and intel xdk, and it all works fine except for when I restart the app. Then the "has product" doesn't seem to work. I have it to request store listing when the layout starts and when store listing has succeeded, then it checks if the user has product ID, if the user does, an ad doesn't show. And if the user doesn't have the product, the ad shows up.

    It works fine when I purchase the product but the second I restart the app, it shows me the ads. And when I try to purchase it again, it says I already have the product. Have I done something wrong or is the plugin broken? Anyone else that has this issue and found a solution?

    Picture of my current event in the main menu:

  • I'm not sure how the product works, and how it checks if the purchase is true, but a simple workaround it would seem, would be to save a variable to localstorage at the time "has product" is true..

  • I'm not sure how the product works, and how it checks if the purchase is true, but a simple workaround it would seem, would be to save a variable to localstorage at the time "has product" is true..

    Yeah that's kind of my last resort, only problem with that is that it's really easy to change the file to set it to true and get rid of ads without purchasing it.

  • Added a screenshot of the events in my first post

  • Maybe you could check if your event and your else event work..

    Using two textobjects and set text would make this clear..

    Also I guessed you wanted to show the add unless the user had product..

    So why not show the add (not using the else) and hide it if user has product..

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Maybe you could check if your event and your else event work..

    Using two textobjects and set text would make this clear..

    Also I guessed you wanted to show the add unless the user had product..

    So why not show the add (not using the else) and hide it if user has product..

    Already done that.

    I have a button that I can click that gives a popup message checking if I have the product. After I purchased it, it's fine and all. No ads, it says I have the product etc.

    But when I restart, the popup says that I don't have the product and ads are back.

    Might as well do it this way. If I don't; then ads will pop out, and then when it's loaded all the products, they will disappear. It'll just look nasty

  • Seems like the issue is with the checking of the store by the plugin..

    You might want to contact the creator of the plugin about that..

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