Difference between marked IAP price and total price

I do not want to load prices like that because internet connection can be slow or user can be offline, or store response can be slow.

I will just write “700 coins or buy a player”.

I do not pay in dollars, and I think I saw 0.99$ on my Android phone…

Thanks.

On Android you might get away with it, on Apple I’m not so sure. You might get lucky if they are testing in the US and it comes up in dollars, although they would expect it to read $0.99 rather than 0.99$.  

Ultimately you need to connect to the store if they make the purchase anyway, so you need to handle slow/offline connections there anyway.

I will think about it… maybe I will load store during game intro phase… in one of the persistant variables… 

Because there is no time during composer.showOverlay

I have only one tier, so it should not be a problem.

Does this call return price symbol together with the price tier?

One problems is I do not know does my custom font have all  worldwide currency symbols…  :huh:

I believe that the “localizedPrice” property contains the currency symbol and “price” does not. So you could just show the number using “price” or find out which symbols your font contains and show “localizedPrice” if it’s one of those fonts.

I would definitely suggest loading during the intro phase rather than when the “store” screen appears if you are able to, that way it’s loaded and ready to go when you need it.

I am using iap badger, so I will see what they offer…

In worst case I will do “700 coins or buy a player”.

Tried to call only one product during intro phase… does not work in the testing phase.

And while buying in sandbox test mode you receive only USD anyway (not other currencies).

Second pitfall is how to find a font that will display all world currencies, and not some strange symbols… or you get three letter code back (I do no know).

Maybe player has to sign in to retrieve product(s) price…

I will go with “700 coins or buy a player” for now.

Thanks!

One hacky fix would be to use 2 text objects:  

First one says "you get a blue player for 700 coins or "

Second one shows the price. 

Then put the second one right next to the first one, and use your custom font on the first and a system font (or a commonly used font) for the price.

If you don’t show a price then the number of people who actually press the purchase button will be drastically lower than if you do.

I thought of that…

In testing I do not get any info from the store…

I will test it… maybe I will use native.systemFont for the currency…

Thanks Alan!
I`ve done it.

localizedPrice property returns 1.24 US$
So I am just using localizedPrice property.

I am only troubled, what font to use.
Because not all fonts hold special characters ( $ )… it would be much nicer if Apple would return USD instead of US$

I will use native.systemFont for second the Text object, to make sure 1.24 US$ is displayed properly.

UPDATE: native.systemFont looks very ugly… I will search for a nicer solution…

It would be easier in terms of fonts if they did that, but most users would expect to see $/£/₽/etc so I think it’s better they return the correct symbol.

This is how I would display the text objects, if it’s useful for you (and for anyone who needs to do the same in future):

local textObj1 = display.newText({ text = "You get a blue player for 700 coins or ", x = Wherever\_You\_want\_X, y = Wherever\_You\_want\_Y, font = Your\_custom\_font, fontSize = 20, align = "center" }) local textObj2 = display.newText({ text = item.localizedPrice, x = 0, y = textObj1.y, font = system.nativeFont, fontSize = 20, align = "center" }) --set the x after creation, so you can use it's width in the calculation textObj2.x = textObj1.x + (textObj1.width \* 0.5) + (textObj2.width \* 0.5)

Thanks Alan!
I did that already.

1.24 US$ looks ugly with native.systemFont

I will try native.systemFontBold instead.

Hi Ivan,

It doesn’t help with your font, but the documentation for getting localised prices through IAP Badger is here:

http://happymongoosegames.co.uk/iapbadger.php?page=tutorial.markdown (see the section marked "getting product price information)

http://happymongoosegames.co.uk/iapbadger.php?page=getLoadProductsCatalogue.markdown

Simon

Thanks Simon!
Good to know!

I love IAP bagder.

Ivan