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

purchaseUpdatedListener is called multipletimes on ios platform

Open Akashdeep312 opened this issue 5 years ago • 10 comments

Please use Discussion board if you want get some help out of it. Please report issue if there is a bug.

using same code as provided in the docs

Version of react-native-iap

^6.0.2

Version of react-native

0.63.3

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

ios

Expected behavior

purchaseUpdatedListener should run only after purchase is completed

Actual behavior

purchaseUpdatedListener is called once a new user is navigated to the subscription page with previous purchases

Tested environment (Emulator? Real Device?)

real device

Steps to reproduce the behavior

run the app of ios device , make a purchase , logout and login again with other user

Akashdeep312 avatar Jul 12 '21 17:07 Akashdeep312

Have you checked if your component is not rerendering?

I am suspecting if this is a similar issue with https://github.com/hyochan/react-native-audio-recorder-player/issues/313

hyochan avatar Jul 13 '21 09:07 hyochan

Have you checked if your component is not rerendering?

I am suspecting if this is a similar issue with hyochan/react-native-audio-recorder-player#313

this is not for recorder @hyochan : )

Akashdeep312 avatar Jul 13 '21 18:07 Akashdeep312

Have you checked if your component is not rerendering? I am suspecting if this is a similar issue with hyochan/react-native-audio-recorder-player#313

this is not for recorder @hyochan : )

Of course I know that. My mistake since I have not make it clear enough.

I wanted you to double check if this is not rerendering issue

hyochan avatar Jul 13 '21 19:07 hyochan

@hyochan ,I am facing the same issue here (its not related to rendering issue).

jerrintkg avatar Jul 27 '21 08:07 jerrintkg

Hi, We are also facing same issue for IOS. Below are full details on the issue:

  1. We purchase a product or subscription using react-native-iap integration. Currently issue seems to be reproducing for subscriptions
  2. We receive the purchase event in purchaseUpdateListner and we send the purchase details to our backend process to make the purchased service available. We create a transaction entry in our DB for the record.
  3. Success is returned to app and we complete the transaction using finishTransaction method
  4. We do receive the subsequent renewable events in purchaseUpdateListener which are processed similarly. DB entries are made for those too.
  5. On next launch of the app, we are again getting the original transaction which was processed and completed successfully.
  6. We are still getting events for transaction which were processed 1-2 months back.

Is there any way to correctly finish those transactions? Also, for how long we will be receiving old transactions? Is there any expiration time limit on these?

Tanuja0049 avatar Aug 09 '21 13:08 Tanuja0049

Hi, I'm also facing same issue for IOS. when i come to purchase screen purchaseUpdateListner is running multiple times

i'm not getting any solution for the same

if there is any thing that is should know , please let me know,

nirbhaisingh1313 avatar Aug 16 '21 06:08 nirbhaisingh1313

It seems that I've got the same, even that listeners are initialized only once.

wishfulthinkerme avatar Sep 17 '21 07:09 wishfulthinkerme

hello. the same issue happens also for auto-renewable subscription products on Android on Sandbox. since 2nd event for the same purchase is triggered right after the first one (2-3 milliseconds later) so it makes the situation more difficult to put a check point on either mobile app code or back-end code. I'm still working on it not to process the same purchase data more than once on back-end.

egulhan avatar Oct 01 '21 12:10 egulhan

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.

stale[bot] avatar Apr 18 '22 18:04 stale[bot]

@Akashdeep312 can you please help us check if this is still an issue on 8.x.x for iOS?

I have found the following as something that is expected from the native SDK: https://stackoverflow.com/a/3633571/570612 If it still happens on 8.x.x and the above doesn't fix. We'll reopen. Thank you

andresesfm avatar Jul 26 '22 22:07 andresesfm