Multi-Resolution Game Development With GameBuilder Studio Check it out!
NEW Version 0.9.7 has arrived! New Blazing Fast Particle Engine & More Game Actions. Check it out
Local Storage with In-App Purchases
  • When using Local Storage actions to save a players best score the data is succesfully stored and I am able to recall the players best score even if the app has been closed by using a State Logic Map for when the GAME_STARTED  use the LOAD local storage action. This works great every time!

    Here is the problem :)
    I’ve been attempting to use this same approach for recalling if a player has paid money for an In-App Purchase to remove-ads.

    I have a Global Property set at 1 if the player has Not purchased the IAP and the Ads show at the appropriate time. At that point if I add a State Logic Map to Load that Global property when GAME_STARTED and the global has not been changed yet the adds never show up when they should.

    Without the State Logic Map added, if a player purchases the IAP, the Global property goes from 1 to zero and then the player plays the game, the ads are gone as they should. The player can die and play again and the ads are still gone which is also correct. But if the app is closed and re-opened, the ads return which is bad, unless the player goes to the settings page and clicks the restore purchase button; then the ads disappear again.(also not ideal)

    So thats why when GAME_STARTED, I was attempting to use a local storage action to LOAD the Global property of whether or not the person had paid (global at 0) or not paid (global at 1). It seems quirky as I’ve uploaded 23 Alpha APK files to Google Play with no luck on this, not sure if it’s a bug? 
  • 2 Comments sorted by
  • @BenFromOregon you should not manage wether a product is purchased or not. Use the "CheckIfPurchased" mode of the IAP action and trigger an action to turn that global property off if the product has been purchased. This should be done on load.

    The restore purchase should only be used by the player if they have purchased an item on one device and they get a new device and want to restore any purchases made in your game. The IAP plugin will handle storing the restored purchases and making it available to the "CheckIfPurchased" mode of the action.
  • Thank you @Lavon for your response and direction. 

    Now, the IAP works! 

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion