IAP plugin “This In-App Purchase has already been bought. It will be restored for free.” issue

IAP plugin “This In-App Purchase has already been bought. It will be restored for free.” issue
0.0 0

#1

Hi,

I’m using IAP plugin in iOS device.

All my goods are consumable.

I got user’s feedbacks about “This In-App Purchase has already been bought. It will be restored for free.” popped out in iOS devices.

After some search, this may be helpful. http://greensopinion.com/2017/03/22/This-In-App-Purchase-Has-Already-Been-Bought.html

Is it possible to fix this issue in SDKBOX lib only?

Or should we take care the issue by ourself? If so, please give us some steps.

Thanks,

Jo


#2

En,
You need to add a menu ‘Restore’ in your game, and call IAP::restore();


#3

But it’s consumable goods. not non-consumable…


#4

Can you double check your iTunes connect? If you see that message it means it’s non-consumable. Only set it in sdkbox_config.json is not enough.


#5

Yes, I’m sure that is consumable.

please check this link https://stackoverflow.com/questions/26937195/in-app-purchase-when-trying-to-buy-consumable-product-again-this-in-app-purc

Jo


#6

Ok, we have to look into it a bit more


#7

have u call enableUserSideVerification(false) ?
Is there any crash ?


#8

I set sdkbox::IAP::enableUserSideVerification(true);
No crash found, but it’s an user feedback, cannot be so sure.

Thanks,
Jo


#9

Hi

Is there any update for this issue?

BRs,
Jo


#10

Still can’t reproduce this issue. If you have steps to reproduce this issue, please let us know.


#11

according to http://greensopinion.com/2017/03/22/This-In-App-Purchase-Has-Already-Been-Bought.html

This scenario can easily occur when an error occurs before calling SKPaymentQueue.default().finishTransaction(transaction).

As I know, it occurs when you bought the goods, but didn’t finishTransaction, maybe because of some network error or crash. Please check your code that if your handle this situation and finishTransaction at some point.

you don’t finishTransaction, then you cannot buy the same goods again.


#12

Ok, maybe some reason, can not get result from server, so did not call finishTransaction. We’ll check the network issue.


#13

I wanna confirm the flow:

  1. send request to Apple server
  2. get receipt from Apple server
  3. call finishTransaction

I’m using the token to send them to my server and verify there, then add goods to users.
When will the callback be called with receipt token?
I thought it was after 3?


#14

yes, it’s right. And you can call

static void finishTransaction(const std::string name);

to finish the transaction.


#15

I don’t understand what you meant.
I though finishTransaction is hidden in your code, no API exposed. (At least in my version)

you said it’s called after finishTransaction, then why should I call it by myself?

What is the exact flow should I follow?


#16

Sorry, I thought u complete the receipt verify by yourself.


#17

Hi
Sorry, maybe I didn’t explain well.

  1. I’m using sdkbox-iap_v2.3.14.3 plugin which has no finishTransaction function in C++ level.
  2. After onsuccess callback, I sent the receipt token to my server, after the server verified it, add goods to user account.

And I encounter the issue I originally posted.

a) in that version v2.3.14.3, at what timing do you call finishTransaction in iOS SDK?
b) how should I fix it?


#18

I encounter the issue too. It is sdkbox bug for IAP.
My IAP don’t verify with server. It is a local game.
I can reproduce the case easily by the following steps:

  1. click the “buy” button.
  2. send request to Apple server by sdkbox sdk.
  3. kill the game by memory warning , let the game killed. (this will caused the finishTransaction function be not called, and the user can’t get any goods from IAP , although the user did purchase success . )
  4. When you restart the game, it will popup out “This In-App Purchase has already been bought. It will be restored for free.” in your iOS devices. And you the user can’t buy the items again.

PS: All my goods are consumable too.

I tried to find some solution but found It have to call the Object C code and this will interrupt the C++ code flow.
Is it possible to fix this issue in SDKBOX lib only?


#19

I checked this issue with 2.3.17.3

precondition

test item is consumable

two cases

TEST ONE

  1. click ‘pucharse’ item
  2. click ‘buy’ button in system IAP dialog
  3. kill the game in Xcode
  4. start the game before “Your purchase was successful.”
  5. got onSuccess called
  6. click ‘purchase’ item
  7. (steps 1~4)
    works fine

TEST TWO

  1. click ‘pucharse’ item
  2. click ‘buy’ button in system IAP dialog
  3. kill the game in Xcode
  4. will for “Your purchase was successful.” message on Home screen
  5. start the game
  6. got onSuccess called
  7. click ‘purchase’ item
  8. (step 1~4)
    works fine.

“This In-App Purchase has already been bought. It will be restored for free.” did not popup with the two cases.


#20

Is it possible that we can have access to your game, so we can try it out as well?