New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
finishTransactionIOS / finishTransaction does nothing for iOS #933
Comments
I have the same issue. |
Can you share the
|
@hyochan |
Same here |
Also in my case, the returned value is undefined (real device with a sandbox user). |
@hyochan When I'm testing debug configuration with sandbox account basically I'm getting notification from Server to Server Notifications(Apple) about a purchase. The problem is that after some time my client listener gets another notification about the purchase but with different transactionId even when purchasing action happened only one time so it looks like problem with properly finish the previous transaction. On Android, everything works fine and I think that is not related to #366 because I don't have any problem to test purchasing process with a sandbox account. useEffect(() => {
purchaseUpdateSubscription.current = purchaseUpdatedListener(
async (purchase: InAppPurchase | SubscriptionPurchase) => {
const receipt = purchase.transactionReceipt;
if (receipt) {
try {
await myBackendHandler({
user,
purchase,
});
const result = await RNIap.finishTransaction(purchase, false);
console.log('result', result);
} catch (e) {
// TODO
}
}
}
);
return () => {
if (purchaseUpdateSubscription.current) {
purchaseUpdateSubscription.current.remove();
purchaseUpdateSubscription.current = null;
}
};
}, []); |
Hey team, thanks for all the hard work on this library, it really makes our lives easier. I'm commenting because this issue hasn't been resolved and I don't see how old transactions not clearing have anything to do with #366 . My usecase is
Expected result:
Actual result
This is just an example of why it is important for this issue to be prioritised. Thanks for reading this long comment... |
same here |
exactly the same problem as above, looks like stack isnt cleared at all, even after disconnecting sandbox/itunes account, reboot device, reinstall app.. :/ |
Could you verify that the Please check
I can't move this issue forward because I am not getting any idea what's happening. I hope somebody can debug things in their environment and share 🙏 |
any update about this issue ? |
up, I am experiencing this problem too. |
same here finishTransactionIOS/finishTransaction this is not working in IOS |
I seem to experience the same thing. // Finish transaction
const ackResult = await finishTransaction(purchase);
console.log("Ack result: ", ackResult); // Ack result: undefined Real device "iPhone 6s" using App Store Sandbox environment. What is the expected result from finishTransaction? Is |
I am also experiencing this issue on iOS, where neither |
@hyochan Though I definitely am not fluent in Objective-C, I added some logs in |
Are you also handling subscription status notifications from the App Store? In my case, I had this problem until I made sure my server handled all notification events properly and responded with a 200. |
@espenjanson Interesting. No, I wasn't. But I actually just switched to expo's InAppPurchases module yesterday and it's all working great now. |
@lachlanglen Nevermind. It was just a single strike of luck (?) or something else. Built another version of the app and the problem is there again. Thinking of doing the same but a little worried that the expo repo is not very well maintained. |
I was having a look into it and it's correct that it returns undefined since the finishTransactions call is not meant to return anything in obj-c. |
@espenjanson I don't know what makes you think that Expo packages are not well-maintained. I think Expo released their iap module pretty recently. If i knew expo had iap module at the time I was implementing iap, i would've picked expo without thinking twice. |
Is there some way to solve this? My Can anybody offer a workaround or explanation why this is happening? |
@zatloeri That is apparently a desired behavior. It took me a while to realize that. App Store will be putting new receipt for renewal in StoreKit which triggers the observer. You should process that receipt and finish the transaction. https://developer.apple.com/videos/play/wwdc2018/705/ (watch in Safari for HD quality) |
@ziyoshams Thanks for the quick reply and for the resources which I will look through in a bit. But first I just want to point out one thing cause I don't think I made it apperent. Product A has expired as verified by I would expect to get all of them on one app start if the subscription is already after its expiration. |
@zatloeri Every transaction that is not finished will appear in that queue, even if it is expired. For monthly subscriptions you should get that receipt every 5 mins or so. Like if you purchase something and come back to the app the next day, you will get 5-6 receipts at the same time. I highly recommend watching those WWDC videos. They are so helpful. |
I am having same issue on iOS, transaction is not getting finished so, Queue is not getting empty and receipt is reappearing every time whenever app launches. i have verified receipt at server side, then finished transaction. Please have a look at my code below i have mentioned few snippets of my code below...
|
@sufyan297 can you please share a snippet from your server-side code? I'm also trying to set up a receipt verification thingy but Apple's document is extremely confusing |
@ziyoshams Are you getting null also using expo iap module finishTransaction method? |
@bcbcbcbcbcl I am not using the expo module. |
+1 to me it returns undefined |
@hyochan any update on this issue? We have been been stuck for quite some time and unable to publish our app. |
Hey there, it looks like there has been no activity on this issue recently. Has the issue been fixed, or does it still require the community's attention? This issue may be closed if no further activity occurs. You may also label this issue as "For Discussion" or "Good first issue" and I will leave it open. Thank you for your contributions. |
Hey there, it looks like there has been no activity on this issue recently. Has the issue been fixed, or does it still require the community's attention? This issue may be closed if no further activity occurs. You may also label this issue as "For Discussion" or "Good first issue" and I will leave it open. Thank you for your contributions. |
Closing this issue after a prolonged period of inactivity. If this issue is still present in the latest release, please feel free to create a new issue with up-to-date information. |
Version of react-native-iap
4.4.1
Version of react-native
0.60.4
Platforms you faced the error (IOS or Android or both?)
iOS
Expected behavior
Upon calling finishTransactionIOS(purchaseId) or finishTransaction(purchase) for a subscription, the transaction should be finished and not be emitted to the app again on next launch. If there was a problem with this, I would expect something to be returned either to the error listener or in a promise from one of the finishTransaction functions, nothing happens.
Android seems to work fine.
Actual behavior
The transaction is emitted on every single launch unless clearTransactionIOS is called, which seems to have other side effects.
Tested environment (Emulator? Real Device?)
Real Device
Steps to reproduce the behavior
I've tried this piles of different ways, and absolutely nothing seems to work, no matter what I do, other than clear the transactions, the purchase is again emitted to the app every single launch. Any ideas what is going on or what I could possibly be doing or understanding wrong?
The text was updated successfully, but these errors were encountered: