playMaker

Author Topic: Getting an in app purchase price (with currency)  (Read 1447 times)

jasperPT

  • Full Member
  • ***
  • Posts: 115
  • I am a VFX Animator teaching myself to make games
Getting an in app purchase price (with currency)
« on: July 29, 2018, 08:33:20 AM »
Hi

I am trying to create a store for my mobile game, and the biggest issue I am having is trying to display the price correctly in game.

I am using Stan's Assets Ultimae mobile package, so that it is cross platform.
The issue I am having is that the only action to get the price of an item is
Get Product Data, which looks like it returns the data from the stan's assets settings, rather than asking for that data from IOS or Android.
This means that it returns a string like so:
0.99

Is there a way to get the localised price of an item ? I am happy to change my plugin or used Unity's built in In app purchasing if it solves the problem.

What I want to be able to get is something like

£0.99
or
$1.35

where it localises the currency properly and displays the actual price of the thing.

Plancksize

  • Beta Group
  • Junior Playmaker
  • *
  • Posts: 75
Re: Getting an in app purchase price (with currency)
« Reply #1 on: July 29, 2018, 08:45:50 AM »
I don't have a lot of experience with stans assets but I do own the android native one and used it a few times in the past.
IIRC while in the editor/runtime in unity, stans assets will fetch the "store data" from it's "dummy" values, that are there present for the sake of testing and such.

I had similar issues when I used it but it was all "editor". After build (and if everything is correct in terms of keys ofc) the functions would actually fetch data from the created google play project/store.

So in sum, while in Unity, the values you're getting are from the "testing elements" and not from Google Play itself.

jasperPT

  • Full Member
  • ***
  • Posts: 115
  • I am a VFX Animator teaching myself to make games
Re: Getting an in app purchase price (with currency)
« Reply #2 on: July 29, 2018, 09:35:19 AM »
Thats what I thought, however it seems to be grabbing that same data when I build it on my iPhone at the moment.

Plancksize

  • Beta Group
  • Junior Playmaker
  • *
  • Posts: 75
Re: Getting an in app purchase price (with currency)
« Reply #3 on: July 29, 2018, 09:54:06 AM »
Hmm weird. I never used the iOS version for it but just in case, you did init Billing and/or have a check for it being initiated?

If not, you may need to call initBilling before doing any billing process, including retrieving data.