-
-
Notifications
You must be signed in to change notification settings - Fork 648
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
[Fix] - Store Kit 1 race condition #2604
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@arthurgeron Could you kindly check on the CI
failing before going further?
https://github.com/dooboolab-community/react-native-iap/actions/runs/6801993699/job/18494078412
Thanks in advance!
Thank you for your patience. I've fixed the SwiftLint errors! |
8ae8d4d
to
7c02787
Compare
@hyochan I'm not sure why the |
Hi, Do you need some help to get through this PR ? What's missing ? :) |
## docs fixes - improve setup of project - remove not working scripts and urls - I managed to get Android example app to work, but unfortunately not the iOS, see notes bellow: ## update `IAPExample` React to `18.2.0` - because of `TypeError: undefined is not an object (evaluating 'ReactCurrentActQueue$1.isBatchingLegacy')` - see here: facebook/react-native#34079 ## iOS exampke currently not buildable because of: - because of obsolete pods: ``` $ yarn pods rbenv: pod: command not found The `pod' command exists in these Ruby versions: 2.7.4 ``` - see here: facebook/react-native#38921 fixed but then build failed ``` The following build commands failed: CompileC /Users/babu/Library/Developer/Xcode/DerivedData/IapExample-ddzasbbwninhdjgvtldlfwsnfkwf/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/RCT-Folly.build/Objects-normal/arm64/json.o /Users/babu/work/powerful-medical/dev/react-native-iap/IapExample/ios/Pods/RCT-Folly/folly/json.cpp normal arm64 c++ com.apple.compilers.llvm.clang.1_0.compiler (in target 'RCT-Folly' from project 'Pods') (1 failure) ``` -> this needs more time and investigation, and the question is, is it worth the time? - anyway added warning for anybody trying to build it regarding this README --------- Co-authored-by: hyochan <[email protected]>
## Why The current example project is somewhat outdated, making it challenging for users to operate with the new SDK. They are required to use an older iOS simulator and manage various legacy issues. ## How Update the RN project to the latest version, `0.72.7`. ## Test Plan <img src="https://github.com/dooboolab-community/react-native-iap/assets/27461460/8df160e6-8e71-433c-ad6d-1e3d96851a1f" width="320"/> Run example projects in `iOS` and `Android`. ## Caveat I'm trying to understand why react-native.config.js isn't effectively embedding the local react-native-iap source code into the project. As of now, I've manually installed react-native-iap in the package.json 🤔. Reference: https://github.com/react-native-community/cli/blob/main/docs/dependencies.md
fixed issue for hyochan#2607 hyochan#2461
- add renewal info (uncomment and serialize) - change debugSerialize to serialize - there is info in this property useful for production not only for development - added transactionReasonIOS enum (to distinguish between type of renewing transactions of purchase events) see also: [JWSTransactionDecodedPayload](https://developer.apple.com/documentation/appstoreserverapi/jwstransactiondecodedpayload)
- addressing the missing currency issue in Storekit 2: https://developer.apple.com/forums/thread/689978 - adding from here: https://developer.apple.com/documentation/storekit/product/4044347-priceformatstyle - as few changes as possible
- adding user canceled error code, so we can distinguish in app what error is intention and what is real error
Update documentation according to Google’s latest requirements
118b7a7
to
7e5cfe4
Compare
@hyochan I've figured out the issue with IAPExample's build on GitHub Action for iOS. Apparently there's some architecture specific issue when running with I took the liberty of adjusting other factors that generated some issues during my testing. Let me know if there's anything else necessary for this to get this merged. |
Hi @hyochan, sorry to bother, was hoping you may be able to take a look at this when you have some time. Thanks!! |
@hyochan @andresesfm just want to give this a final try, hoping we can get some eyes on this, thank you so much |
While not ideal, you can use patch-package to test and apply this fix to your project. Just replace the files in |
@hyochan |
@arthurgeron I apologize for the delayed code review. If I understood your comment correctly, you want to handle Once again, I apologize for the delay and any inconvenience caused. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
GPT says it is perfect!
#2763 (comment)
@arthurgeron Could you kindly check this? Then I can quickly merge this and deploy to newer version! |
14699d7
to
0e7baaf
Compare
Welcome back @hyochan! |
cd8af05
to
60cd156
Compare
@hyochan CI issues fixed but Github Actions is acting up 😅 |
NP! It is working now :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
Thanks guys ! You rock ! 🚀 |
Fixes: #1696, #2372
Similar to #2518, this fixes race condition crashes on
validProducts
andproductsRequest
in RNIapIos.swift when using Store Kit 1.React Native IAP
What was done:
validProducts
.productsRequest
are made in parallel. By resolving only one promise at any given time (only forproductsRequest
), we eliminate any possibility of causing racing conditions or bad exec exceptions while storing the resolved data.IAPExample (iOS)