IAP for android product id syntax

HI,

I am still battling IAP, but I am finally somewhere.

set up test account in GP

added IAP and made active in GP

tested with the android.test.purchased etc and all fine.

However when I try to test with the IAP product I created I get:

ERROR: the item you are trying to purchase could not be found.

Hence my question regarding syntax.

My product is called : removeme

my build is : themonsters.pixel.co.uk

so my product ID call is: themonsters.pixel.co.uk.removeme

Yes or no ?

No, that’s a common source of confusion.  If the product name is ‘removeme’, then that’s the product name, and that’s what you have to pass to store.purchase().  Your bundle name doesn’t automatically get prepended do it.

As a best practice, though, it’s a good idea to name your product including your bundle name so it doesn’t conflict with anyone else.  You could name your product ‘themonsters.pixel.co.uk.removeme’ like you mentioned, you just have to write it out like that explicitly.

  • Andrew

No.  Your ProductID is removeme which is what you will use for purchase(IE store.purchase({“removeme”}).  It’s up to you to add the package identifier. If you aren’t in a rush I would remake the IAP using your full package identifier as that is really best practice.

Also, it can take Google a few hours to get your IAP changes propagated too all of their servers.  This means if you create an IAP you have to wait a bit to test it.

Excellent so to clarify:

In IAP in Google developer console my product is named: removeme

so for example:

local productID =
{
    “removeme”, --buy this item

}

but best practice is:

In IAP in Google developer console my product is named: themonsters.pixel.co.uk.removeme

so for example:

local productID =
{
    “themonsters.pixel.co.uk.removeme”, – by this item

}

yes ?

thank you

Yes

thanks guys,

all working fine and transactions going through, it really is easy once you know how.

I wonder if you can answer another couple of questions please. Stilll IAP for android :slight_smile:

in my transaction callback once the item has been purchased I call a function to remove the ads, that is fine.

So should I set a boolean i.e. removeads = true on the users device in say a text file? that can be checked when the game is restarted each time?

Should I set it like I save and recall my highscores ? or do something else?

Any code snippet available to make sure I do it right ?

Last question for now :slight_smile: , do I need a restore button? if so how do I go about the restore of the paid item? I read I had to first delete the text file that holds the boolean: removeads = true,  first  and then call restore ?

again any code snippet to point me in the correct direction would be awesome.

Thanks for your patience guys its quite a learning curve IAP but at least I understand the purchasing and payment steps now.

Last question for now,

You can use a text file or a SQLite DB to check if ads are enabled or not.  Pretty much just like how you keep track of high scores most likely.  I have no code snippet available however.

If you have any non-consumable IAP item you should have a restore purchases button.  Apple requires it(in case you start publishing there).  With Google the restore purchase function  will actually come through as a regular purchase.  If all your code  to handle the remove ads flag is done during the purchase than you most likely won’t need to do any extra work for the restore.  It will just work.  Obviously you would want to test it.

thank you

No, that’s a common source of confusion.  If the product name is ‘removeme’, then that’s the product name, and that’s what you have to pass to store.purchase().  Your bundle name doesn’t automatically get prepended do it.

As a best practice, though, it’s a good idea to name your product including your bundle name so it doesn’t conflict with anyone else.  You could name your product ‘themonsters.pixel.co.uk.removeme’ like you mentioned, you just have to write it out like that explicitly.

  • Andrew

No.  Your ProductID is removeme which is what you will use for purchase(IE store.purchase({“removeme”}).  It’s up to you to add the package identifier. If you aren’t in a rush I would remake the IAP using your full package identifier as that is really best practice.

Also, it can take Google a few hours to get your IAP changes propagated too all of their servers.  This means if you create an IAP you have to wait a bit to test it.

Excellent so to clarify:

In IAP in Google developer console my product is named: removeme

so for example:

local productID =
{
    “removeme”, --buy this item

}

but best practice is:

In IAP in Google developer console my product is named: themonsters.pixel.co.uk.removeme

so for example:

local productID =
{
    “themonsters.pixel.co.uk.removeme”, – by this item

}

yes ?

thank you

Yes

thanks guys,

all working fine and transactions going through, it really is easy once you know how.

I wonder if you can answer another couple of questions please. Stilll IAP for android :slight_smile:

in my transaction callback once the item has been purchased I call a function to remove the ads, that is fine.

So should I set a boolean i.e. removeads = true on the users device in say a text file? that can be checked when the game is restarted each time?

Should I set it like I save and recall my highscores ? or do something else?

Any code snippet available to make sure I do it right ?

Last question for now :slight_smile: , do I need a restore button? if so how do I go about the restore of the paid item? I read I had to first delete the text file that holds the boolean: removeads = true,  first  and then call restore ?

again any code snippet to point me in the correct direction would be awesome.

Thanks for your patience guys its quite a learning curve IAP but at least I understand the purchasing and payment steps now.

Last question for now,

You can use a text file or a SQLite DB to check if ads are enabled or not.  Pretty much just like how you keep track of high scores most likely.  I have no code snippet available however.

If you have any non-consumable IAP item you should have a restore purchases button.  Apple requires it(in case you start publishing there).  With Google the restore purchase function  will actually come through as a regular purchase.  If all your code  to handle the remove ads flag is done during the purchase than you most likely won’t need to do any extra work for the restore.  It will just work.  Obviously you would want to test it.

thank you