playMaker

Author Topic: In App Purchase logic[SOLVED]  (Read 1123 times)

TerraImagina

  • Playmaker Newbie
  • *
  • Posts: 33
In App Purchase logic[SOLVED]
« on: February 27, 2020, 05:32:38 AM »
Hello,
 
I am trying to create In app purchase using easy mobile pro.
They have playmaker action that is why I bought it

I copied the FSM that allow to buy, created the Products on apple store page and set everything, and it seems to work on my build device (exept I cannot buy the Product when the app is not released yet)

The question is :
How do I connect to my actual content (I want to unlock some scenes, or some models)
to the products ?

Is there someone who already used IAP and could explain me the logic and the setup ?
How to retrieve information of product purchase
Should I save those informations ? (Via player prefs?)

I guess it is not dependant from any IAP asset.

Thank you for the help :)
« Last Edit: March 02, 2020, 05:59:04 AM by jeanfabre »

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: In App Purchase logic
« Reply #1 on: February 28, 2020, 01:16:11 AM »
Hi,

 you need to maintain a look up table that relate what you want to offer for a given a purchased product ID.

you could make fsm that listen to all purchase and they compare the product bought and if it matches then they proceed.

you can indeed use PlayerPrefs, but don't forget than purchased items should be available even if the user deinstall and reinstall the game, so make sure that you implement purchase restore procedure as well.

Bye,

 Jean

Broken Stylus

  • Beta Group
  • Hero Member
  • *
  • Posts: 773
Re: In App Purchase logic
« Reply #2 on: February 28, 2020, 01:58:11 PM »
Each one of your products has an ID.
You must use a list of these IDs within your app to call the Apple or Google server to ask if, first, the item exists, then if it is available, and finally validate the purchase.
The plugin does this by verifying a call for purchase to the server using an item's ID.
You decide if you want to put that in an array, a table or some XML file, and probably have this list be accessed by a Game Object dedicated to purchases.

TerraImagina

  • Playmaker Newbie
  • *
  • Posts: 33
Re: In App Purchase logic
« Reply #3 on: March 01, 2020, 05:03:07 AM »
Thank you Jean and Broken Stylus!
This was a great help once again, really appreciate your support!
Regards