How to handle "you've already purchased this"

Hi All, I managed to get in-app purchases working on both android and iOS and I thought I was in the clear… but if I delete and reinstall my app from googleplay I cannot restore the already purchased content.

Google play tells me I already own the content via a pop-up… but I don’t know how to detect this pop-up so that I can unlock the item in the code. Any ideas?

Also, am I correct to understand that “restore” doesn’t do much with googleplay?

Thanks so much!
Tim [import]uid: 129205 topic_id: 35350 reply_id: 335350[/import]

First you need to specify a test account in the Developer Console. The test account must be used when you test your IAP implementation on your device. A test account can be any gmail account as long as it’s different from your developer account.
You also need to dedicate a device to your test account, as the account has to be the main account on the device. The only way to guarantee this is during setup of the device. To change the account on the device, you’ll do a Factory Reset and set up the device with your Test Account.

Once you make a purchase from a device with a registered test account, you’ll be able to test the restore feature (which will return a ‘purchased’ event). If you try to buy the same IAP product again, you’ll get a “you already own this content” message, and the transaction will fail.
To be able to re-purchase the IAP product again, you need to go to your Google Merchant account and cancel the first purchase you made. After you’ve done that it will take a “few hours” before the Google system has propagated the cancellation. In my experience it can take quite a while before the cancellation has propagated, but 2-3 hours seems to be the mean time taken.
[import]uid: 70847 topic_id: 35350 reply_id: 140534[/import]

Thanks Swipeware. So there isn’t any way to detect that an “already purchased” error has been issued and unlock the content for the user based on this error? I don’t want the purchaser to have to clear the purchase and repurchase.
Thanks!
Tim [import]uid: 129205 topic_id: 35350 reply_id: 140549[/import]

The procedure I described above is only for developers, not users. A developer test account can roll back purchases so that you can re-purchase an item for testing purposes.

You should implement a “Restore” button in your app so that your users will be able to restore their IAP items.

Once an IAP item is purchased, a user will not be able to re-purchase an item regardless if you cancel the transaction or not.
Keep in mind that store.restore() will return a “purchased” event, not a “restored” event, if Google finds that the user has purchased the item before. Also keep in mind that a restore will only work for managed IAP items.
For unmanaged items you’ll need your own server to register and keep track of the purchases/restores yourself. [import]uid: 70847 topic_id: 35350 reply_id: 140584[/import]

Thanks again! Could someone confirm that a store.restore() for android returns a purchased along with the product identifier for each item being restored? So if there are 3 items to restore I should get:
Purchased product id 1
Purchased product id 2
Purchased product id 3

Thanks! [import]uid: 129205 topic_id: 35350 reply_id: 140622[/import]

First you need to specify a test account in the Developer Console. The test account must be used when you test your IAP implementation on your device. A test account can be any gmail account as long as it’s different from your developer account.
You also need to dedicate a device to your test account, as the account has to be the main account on the device. The only way to guarantee this is during setup of the device. To change the account on the device, you’ll do a Factory Reset and set up the device with your Test Account.

Once you make a purchase from a device with a registered test account, you’ll be able to test the restore feature (which will return a ‘purchased’ event). If you try to buy the same IAP product again, you’ll get a “you already own this content” message, and the transaction will fail.
To be able to re-purchase the IAP product again, you need to go to your Google Merchant account and cancel the first purchase you made. After you’ve done that it will take a “few hours” before the Google system has propagated the cancellation. In my experience it can take quite a while before the cancellation has propagated, but 2-3 hours seems to be the mean time taken.
[import]uid: 70847 topic_id: 35350 reply_id: 140534[/import]

Thanks Swipeware. So there isn’t any way to detect that an “already purchased” error has been issued and unlock the content for the user based on this error? I don’t want the purchaser to have to clear the purchase and repurchase.
Thanks!
Tim [import]uid: 129205 topic_id: 35350 reply_id: 140549[/import]

The procedure I described above is only for developers, not users. A developer test account can roll back purchases so that you can re-purchase an item for testing purposes.

You should implement a “Restore” button in your app so that your users will be able to restore their IAP items.

Once an IAP item is purchased, a user will not be able to re-purchase an item regardless if you cancel the transaction or not.
Keep in mind that store.restore() will return a “purchased” event, not a “restored” event, if Google finds that the user has purchased the item before. Also keep in mind that a restore will only work for managed IAP items.
For unmanaged items you’ll need your own server to register and keep track of the purchases/restores yourself. [import]uid: 70847 topic_id: 35350 reply_id: 140584[/import]

Thanks again! Could someone confirm that a store.restore() for android returns a purchased along with the product identifier for each item being restored? So if there are 3 items to restore I should get:
Purchased product id 1
Purchased product id 2
Purchased product id 3

Thanks! [import]uid: 129205 topic_id: 35350 reply_id: 140622[/import]

Hi,

I tried all the above steps. But, it keeps saying me following message, “Sorry, Could not able to connect itunes”.

Restore functionality is also not working, “transactionCallback” function is not executing, I waited for it more than 5 minutes. If user has already purchased more than one product then, will it give list of all “productIdentifier” or only of one product.

Kindly, please me help me…

Thanks. [import]uid: 69970 topic_id: 35350 reply_id: 143440[/import]

Hi,

I tried all the above steps. But, it keeps saying me following message, “Sorry, Could not able to connect itunes”.

Restore functionality is also not working, “transactionCallback” function is not executing, I waited for it more than 5 minutes. If user has already purchased more than one product then, will it give list of all “productIdentifier” or only of one product.

Kindly, please me help me…

Thanks. [import]uid: 69970 topic_id: 35350 reply_id: 143440[/import]

Hi,

I tried all the above steps. But, it keeps saying me following message, “Sorry, Could not able to connect itunes”.

Restore functionality is also not working, “transactionCallback” function is not executing, I waited for it more than 5 minutes. If user has already purchased more than one product then, will it give list of all “productIdentifier” or only of one product.

Kindly, please me help me…

Thanks. [import]uid: 69970 topic_id: 35350 reply_id: 143440[/import]

Hi,

I tried all the above steps. But, it keeps saying me following message, “Sorry, Could not able to connect itunes”.

Restore functionality is also not working, “transactionCallback” function is not executing, I waited for it more than 5 minutes. If user has already purchased more than one product then, will it give list of all “productIdentifier” or only of one product.

Kindly, please me help me…

Thanks. [import]uid: 69970 topic_id: 35350 reply_id: 143440[/import]