• Categories
  • Recent
  • Tags
  • Popular
  • Solved
  • Unsolved
  • Users
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (Darkly)
  • No Skin
Collapse
brainCloud Forums

Understanding VerifyPurchases for "Non-Consumables"

Scheduled Pinned Locked Moved Solved APIs
non-consumableverifypurchases
4 Posts 2 Posters 424 Views
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    Davis Knox
    wrote on last edited by
    #1

    Hi there,

    I have a mobile application that I am planning to release on both Android and iOS. My monetization strategy is to have a virtual currency and then a cosmetic store where the user can unlock items via VC. The user earns VC via gameplay and also upon watching ads. I also allow the user to purchase VC via IAP (which I can use VerifyPurchases on brain cloud to award to the user). I was also going to sell a coin boost that is not purchasable via VC (IAP only).

    I am seeing that VerifyPurchases automatically will award VC to my server-side VC balance upon a successful verify. What happens with Non-Consumable products (like my coin booster) upon successful verification? I don't see anything in the available APIs to read if a product was successfully purchased. Is it now up to the client to then save more data on braincloud to log this purchase, or to use a post hook on verifyPurchases to record this purchase? I am currently keeping track of my unlocks in player statistics. What's the best practice here?

    Thanks,
    Davis

    1 Reply Last reply
    0
  • Paul WinterhalderP Offline
    Paul WinterhalderP Offline
    Paul Winterhalder brainCloudAdmin
    wrote on last edited by
    #2

    Hi Davis,

    As with most things brainCloud - there are a few ways that you could approach this.

    You could certainly use player statistics - as you are for your other unlocks.

    brainCloud allows you to attach "extra data" to a product - they are essentially key+value pairs, that get returned as a simple JSON map in the VerifyPurchase response.

    You could catch that response on the client, or for more security, do it from the server - either via a cloud code script that wraps the VerifyPurchase() call itself, or as you said, a post-hook on the VerifyPurchase call. Just update the named "statistic" based on the "extra data" portion of the VerifyPurchase response.

    There is one other way of doing this - which is to have a special currency for your "coin booster". <- brainCloud allows you to have as many as you want.

    To use it, simply create a currency called "coinBooster" - and allow the customer to buy one of them. Voila - no custom code!

    Hope that helps!

    Paul.

    1 Reply Last reply
    0
  • D Offline
    D Offline
    Davis Knox
    wrote on last edited by
    #3

    Thanks Paul that all makes sense. I will likely go with wrapping the Verify call in a cloud script to be consistent with my other purchase code.

    1 Reply Last reply
    0
  • Paul WinterhalderP Offline
    Paul WinterhalderP Offline
    Paul Winterhalder brainCloudAdmin
    wrote on last edited by
    #4

    Happy to help! 👍

    1 Reply Last reply
    0

  • Login

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • Solved
  • Unsolved
  • Users