react-native-iap icon indicating copy to clipboard operation
react-native-iap copied to clipboard

iOS: This in-app purchase has already been bought.

Open codal-mpawar opened this issue 3 years ago • 10 comments

@hyochan @ospfranco @FallenDestiny @cjpete Can you please let us know so we can release our build it's breaking for our release. we saw other issues but that is old so we create a new one.

we are dealing with product identifiers com.package.tippingX and at a time only 1 transaction. Where X could be 1,2,3,4. Or some time create old receipt so can any one help on that too. RNIap.requestPurchase( tipProductId, false, user_id, user_id ).then(async (purchase) => { props.apicall(params,async()=>{ api call success const result = await RNIap.finishTransaction(purchase, true); // because product is consumable. isConsumable: true console.log("result :::::", result) },async(error)=>{ api call error const result = await RNIap.finishTransaction(purchase, true); // because product is consumable. isConsumable: true console.log("error :::::", error) }); }).catch(async(error)=>{ console.log("error :::::", error) await RNIap.clearTransactionIOS(); })

Version of react-native-iap

"react-native-iap": "^7.5.1"

Version of react-native

"react-native": "0.64.2",

Platforms you faced the error (IOS or Android or both?)

IOS

Expected behavior

Makes a purchase

Actual behavior

Currently, we get This in-app purchase has already been bought.

Tested environment (Emulator? Real Device?)

Real device

Screen Shot 2021-12-17 at 2 57 31 PM

File

codal-mpawar avatar Dec 17 '21 10:12 codal-mpawar

Let us know if you need more information.

codal-mpawar avatar Dec 17 '21 10:12 codal-mpawar

have the same issue on the build from testflight, not reproduced locally, wondering could it be related to new 15.2 ios, not sure but looks like before I've never seen such issue

vitali-kastsiuk avatar Dec 17 '21 19:12 vitali-kastsiuk

Having the same issue on testflight/sandbox, by the way is there any difference between finishtransaction and finishtransactionIOS ?

ugrdursun avatar Dec 20 '21 15:12 ugrdursun

@ugrdursun we call two RNIAP functions Yes we get issues with TF build and sandbox account First, we call RNIap.clearTransactionIOS() and then request for purchase RNIap.requestPurchase() and after success RNIap.finishTransaction(purchase, true). At first already code has shared.

codal-mpawar avatar Dec 21 '21 05:12 codal-mpawar

I have a similar issue in a TestFlight build and I don't call clearTransactionIOS or finishTransaction after calling requestPurchase, nor do I persist any purchase data.

Expected After getting the transactionId from the InAppPurchase object returned by requestPurchase, the user should be able to purchase the same consumable item again.

Actual The payment dialog is bypassed and the object containing an old transactionId from the previous purchase is returned, even after starting a new session.

consumables

psdewar avatar Dec 22 '21 20:12 psdewar

@hyochan @ospfranco @FallenDestiny @cjpete Hey guys, Any update on this. we have released and we are stuck here.

codal-mpawar avatar Jan 03 '22 11:01 codal-mpawar

Any updates on this topic? will the problem be found in the release version?

andreysoldatenkow avatar Feb 04 '22 09:02 andreysoldatenkow

We are using this library with millions of users and thousands of purchases daily and we are not facing any issue, your problem is likely somewhere else

ospfranco avatar Feb 04 '22 10:02 ospfranco

I have the same problem, any solutions?

@ospfranco Just to be sure, When the clearTransactionIOS function should be called?

@codal-mpawar have you resolved this in some way?

emberist avatar Feb 16 '22 10:02 emberist

@ugrdursun we call two RNIAP functions Yes we get issues with TF build and sandbox account First, we call RNIap.clearTransactionIOS() and then request for purchase RNIap.requestPurchase() and after success RNIap.finishTransaction(purchase, true). At first already code has shared.

hi @ugrdursun if you are using same build and getting issue only on testflight build then you can try purchasing the product with your apple id which you have added into testflight instead of using sandbox test credentials , i was having the same issue just try it once and let me know  🙂

Akashdeep312 avatar Mar 22 '22 15:03 Akashdeep312