playMaker

Author Topic: Need help with Codeless IAP  (Read 9900 times)

psguy

  • Playmaker Newbie
  • *
  • Posts: 2
Need help with Codeless IAP
« on: May 18, 2019, 11:13:32 PM »
Hi everyone!

I need some help with implementing IAP in my project, hoping you guys can help me out.
I've tried Easy IAP and facing trouble with it (looking through the forum posts, at least one other person is having same trouble - it doesn't work on Android build on device.)

Some of the forum posts have said Unity's own Codeless IAP is a good way to go. If so, can someone tell me how do I build logic around it? I mean, how to check if a user has already bought a non-consumable and take actions accordingly etc.?

PlaymakerNOOB

  • Full Member
  • ***
  • Posts: 219
Re: Need help with Codeless IAP
« Reply #1 on: May 19, 2019, 11:19:36 AM »
You can follow the official documentation here:   https://docs.unity3d.com/Manual/UnityIAPSettingUp.html

Get these Playmaker actions:  https://github.com/dumbgamedev/IAP_Playmaker

In Unity, goto Window > Unity IAP > IAP Catalog

ID = com.psguy.newgame.disablead
Type = Non Consumable

Fill in title + description, as these are what your players will see if they try to buy on IOS/Android.  Then click on App Store Export and pick the export for your store of choice.

Next, you will want to export a copy of the game and upload it to the store of your choice. In my example, I am using google play developer console.  Once thats done, go to the main page of the console:  https://play.google.com/apps/publish/ find your app and click on it.  Then go to Store Presence > In-App Products > Manage Products then click on import / export, locate the file you exported and import it.  save.

basic flow would be to check to see if encrypted player prefs exist (easy save3) or playerprefs. If not, goto state WaitForInput with 2 states called 'Success' and 'Fail'. If purchase success, create playerpref, if purchase failed, reset (goto start state)

Window > Unity IAP > Create IAP Button -- this will make a new button in the scene.  Set the product id (com.psguy.newgame.disablead) to what you made earlier.  Set Button Type to purchase, and it will have 2 settings.  On Purchase Complete and On Purchase Fail.

Have Purchase Complete set to Editor and Runtime with PlaymakerFSM.Send Event, then find the gameobject with the FSM you wish to manage and for the event name call it 'Success'.  Do the same for On Purchase Failed, but have the event name be 'Fail'

psguy

  • Playmaker Newbie
  • *
  • Posts: 2
Re: Need help with Codeless IAP
« Reply #2 on: May 20, 2019, 05:57:58 PM »
Thank you so very much! That was a wonderfully through walkthrough!

I am out of my country for vacation, today's the first day, can't wait to do this when I get back. :)

I hope you won't mind helping me out in case I get stumped then! You made everything sound very simple and straightforward, hopefully I won't have any hiccups.

Cheers!

Broken Stylus

  • Beta Group
  • Hero Member
  • *
  • Posts: 772
Re: Need help with Codeless IAP
« Reply #3 on: April 06, 2021, 06:16:33 AM »
You can follow the official documentation here:   https://docs.unity3d.com/Manual/UnityIAPSettingUp.html

Get these Playmaker actions:  https://github.com/dumbgamedev/IAP_Playmaker

1. Are these actions up to date?
2. If yes, would they or some similar be in Playmaker by default?

CuriousRodeo

  • Playmaker Newbie
  • *
  • Posts: 11
Re: Need help with Codeless IAP
« Reply #4 on: May 26, 2021, 01:58:09 PM »
The actions seem to be up to date.  I was able to impliment Unity IAP in my game with the current actions working.

It took me a while to figure out though, because all of the videos I watched made it look like all you had to do was set up your IAP on the Unity side.

At least for me, developing a game for Android, I DID have to go onto the Google Play Developer Console and create the item I was trying to offer in my IAP.  And I did have to get the Key that Unity is looking for in the Build Settings > Player Settings > Services > Ian App Purchases > Options


Broken Stylus

  • Beta Group
  • Hero Member
  • *
  • Posts: 772
Re: Need help with Codeless IAP
« Reply #5 on: May 28, 2021, 06:19:31 AM »
Oh yes, that's a mandatory step, you absolutely need to create the catalog of items on all platforms (Apple App Store, Google Play, etc.).
By chance Unity's IAP Catalog function is quite well done.
The greatest hassle imho is on Google's side. Long gone are the days where it was so quick to add stuff to their already not so intuitive Console. The crisscross of deployment patterns and verisimilitude of Google APIs can be confusing and infuriating.