iamport-react-native 2.0.13 → 2.0.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.circleci/config.yml +98 -0
- package/.editorconfig +15 -0
- package/.gitattributes +3 -0
- package/.gitignore +69 -0
- package/.yarnrc +3 -0
- package/.yarnrc.yml +1 -0
- package/README.md +1 -1
- package/android/.gradle/8.9/checksums/checksums.lock +0 -0
- package/android/.gradle/8.9/checksums/md5-checksums.bin +0 -0
- package/android/.gradle/8.9/checksums/sha1-checksums.bin +0 -0
- package/android/.gradle/8.9/dependencies-accessors/gc.properties +0 -0
- package/android/.gradle/8.9/executionHistory/executionHistory.lock +0 -0
- package/android/.gradle/8.9/fileChanges/last-build.bin +0 -0
- package/android/.gradle/8.9/fileHashes/fileHashes.lock +0 -0
- package/android/.gradle/8.9/gc.properties +0 -0
- package/android/.gradle/buildOutputCleanup/buildOutputCleanup.lock +0 -0
- package/android/.gradle/buildOutputCleanup/cache.properties +2 -0
- package/android/.gradle/vcs-1/gc.properties +0 -0
- package/babel.config.js +3 -0
- package/example/.gitignore +69 -0
- package/example/README.md +44 -0
- package/example/android/.gradle/7.5.1/checksums/checksums.lock +0 -0
- package/example/android/.gradle/7.5.1/checksums/md5-checksums.bin +0 -0
- package/example/android/.gradle/7.5.1/checksums/sha1-checksums.bin +0 -0
- package/example/android/.gradle/7.5.1/dependencies-accessors/dependencies-accessors.lock +0 -0
- package/example/android/.gradle/7.5.1/dependencies-accessors/gc.properties +0 -0
- package/example/android/.gradle/7.5.1/executionHistory/executionHistory.lock +0 -0
- package/example/android/.gradle/7.5.1/fileChanges/last-build.bin +0 -0
- package/example/android/.gradle/7.5.1/fileHashes/fileHashes.bin +0 -0
- package/example/android/.gradle/7.5.1/fileHashes/fileHashes.lock +0 -0
- package/example/android/.gradle/7.5.1/gc.properties +0 -0
- package/example/android/.gradle/buildOutputCleanup/buildOutputCleanup.lock +0 -0
- package/example/android/.gradle/buildOutputCleanup/cache.properties +2 -0
- package/example/android/.gradle/vcs-1/gc.properties +0 -0
- package/example/android/app/build.gradle +183 -0
- package/example/android/app/debug.keystore +0 -0
- package/example/android/app/proguard-rules.pro +10 -0
- package/example/android/app/src/debug/AndroidManifest.xml +8 -0
- package/example/android/app/src/debug/java/com/example/iamportreactnative/ReactNativeFlipper.java +69 -0
- package/example/android/app/src/main/AndroidManifest.xml +34 -0
- package/example/android/app/src/main/java/com/example/iamportreactnative/MainActivity.java +15 -0
- package/example/android/app/src/main/java/com/example/iamportreactnative/MainApplication.java +80 -0
- package/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png +0 -0
- package/example/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png +0 -0
- package/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png +0 -0
- package/example/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png +0 -0
- package/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png +0 -0
- package/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png +0 -0
- package/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png +0 -0
- package/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png +0 -0
- package/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png +0 -0
- package/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png +0 -0
- package/example/android/app/src/main/res/values/strings.xml +3 -0
- package/example/android/app/src/main/res/values/styles.xml +9 -0
- package/example/android/build.gradle +21 -0
- package/example/android/gradle/wrapper/gradle-wrapper.jar +0 -0
- package/example/android/gradle/wrapper/gradle-wrapper.properties +6 -0
- package/example/android/gradle.properties +44 -0
- package/example/android/gradlew +183 -0
- package/example/android/gradlew.bat +103 -0
- package/example/android/settings.gradle +9 -0
- package/example/app.json +4 -0
- package/example/babel.config.js +11 -0
- package/example/index.js +5 -0
- package/example/ios/File.swift +8 -0
- package/example/ios/Gemfile +7 -0
- package/example/ios/Gemfile.lock +99 -0
- package/example/ios/IamportReactNativeExample/AppDelegate.h +15 -0
- package/example/ios/IamportReactNativeExample/AppDelegate.mm +138 -0
- package/example/ios/IamportReactNativeExample/Images.xcassets/AppIcon.appiconset/Contents.json +53 -0
- package/example/ios/IamportReactNativeExample/Images.xcassets/Contents.json +6 -0
- package/example/ios/IamportReactNativeExample/Info.plist +121 -0
- package/example/ios/IamportReactNativeExample/LaunchScreen.storyboard +58 -0
- package/example/ios/IamportReactNativeExample/main.m +16 -0
- package/example/ios/IamportReactNativeExample-Bridging-Header.h +3 -0
- package/example/ios/IamportReactNativeExample.xcodeproj/project.pbxproj +969 -0
- package/example/ios/IamportReactNativeExample.xcodeproj/xcshareddata/xcschemes/IamportReactNativeExample.xcscheme +99 -0
- package/example/ios/IamportReactNativeExample.xcworkspace/contents.xcworkspacedata +10 -0
- package/example/ios/IamportReactNativeExample.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +8 -0
- package/example/ios/Podfile +57 -0
- package/example/ios/Podfile.lock +756 -0
- package/example/metro.config.js +66 -0
- package/example/package.json +40 -0
- package/example/src/App.tsx +17 -0
- package/example/src/Certification/index.tsx +30 -0
- package/example/src/CertificationResult/index.tsx +79 -0
- package/example/src/CertificationTest/index.tsx +214 -0
- package/example/src/Home/index.tsx +87 -0
- package/example/src/Loading/index.tsx +12 -0
- package/example/src/NavigationService.tsx +127 -0
- package/example/src/Payment/index.tsx +28 -0
- package/example/src/PaymentResult/index.tsx +96 -0
- package/example/src/PaymentTest/index.tsx +383 -0
- package/example/src/Picker/index.tsx +60 -0
- package/example/src/constants.ts +274 -0
- package/example/src/utils.ts +83 -0
- package/example/yarn.lock +7358 -0
- package/exampleForExpo/.buckconfig +6 -0
- package/exampleForExpo/.expo/README.md +8 -0
- package/exampleForExpo/.expo/devices.json +3 -0
- package/exampleForExpo/.gitattributes +1 -0
- package/exampleForExpo/.gitignore +125 -0
- package/exampleForExpo/.idea/.gitignore +3 -0
- package/exampleForExpo/.idea/caches/deviceStreaming.xml +549 -0
- package/exampleForExpo/.idea/exampleForExpo.iml +9 -0
- package/exampleForExpo/.idea/misc.xml +6 -0
- package/exampleForExpo/.idea/modules.xml +8 -0
- package/exampleForExpo/.idea/vcs.xml +6 -0
- package/exampleForExpo/.idea/workspace.xml +53 -0
- package/exampleForExpo/README.md +58 -0
- package/exampleForExpo/__tests__/App.js +10 -0
- package/exampleForExpo/android/.gitignore +21 -0
- package/exampleForExpo/android/.gradle/7.5.1/checksums/checksums.lock +0 -0
- package/exampleForExpo/android/.gradle/7.5.1/fileChanges/last-build.bin +0 -0
- package/exampleForExpo/android/.gradle/7.5.1/fileHashes/fileHashes.lock +0 -0
- package/exampleForExpo/android/.gradle/7.5.1/gc.properties +0 -0
- package/exampleForExpo/android/.gradle/vcs-1/gc.properties +0 -0
- package/exampleForExpo/android/app/BUCK +55 -0
- package/exampleForExpo/android/app/build.gradle +362 -0
- package/exampleForExpo/android/app/build_defs.bzl +19 -0
- package/exampleForExpo/android/app/debug.keystore +0 -0
- package/exampleForExpo/android/app/proguard-rules.pro +14 -0
- package/exampleForExpo/android/app/src/debug/AndroidManifest.xml +7 -0
- package/exampleForExpo/android/app/src/debug/java/kr/iamport/exampleForExpo/ReactNativeFlipper.java +69 -0
- package/exampleForExpo/android/app/src/main/AndroidManifest.xml +34 -0
- package/exampleForExpo/android/app/src/main/java/kr/iamport/exampleForExpo/MainActivity.java +83 -0
- package/exampleForExpo/android/app/src/main/java/kr/iamport/exampleForExpo/MainApplication.java +106 -0
- package/exampleForExpo/android/app/src/main/java/kr/iamport/exampleForExpo/newarchitecture/MainApplicationReactNativeHost.java +117 -0
- package/exampleForExpo/android/app/src/main/java/kr/iamport/exampleForExpo/newarchitecture/components/MainComponentsRegistry.java +36 -0
- package/exampleForExpo/android/app/src/main/java/kr/iamport/exampleForExpo/newarchitecture/modules/MainApplicationTurboModuleManagerDelegate.java +48 -0
- package/exampleForExpo/android/app/src/main/jni/CMakeLists.txt +7 -0
- package/exampleForExpo/android/app/src/main/jni/MainApplicationModuleProvider.cpp +32 -0
- package/exampleForExpo/android/app/src/main/jni/MainApplicationModuleProvider.h +16 -0
- package/exampleForExpo/android/app/src/main/jni/MainApplicationTurboModuleManagerDelegate.cpp +45 -0
- package/exampleForExpo/android/app/src/main/jni/MainApplicationTurboModuleManagerDelegate.h +38 -0
- package/exampleForExpo/android/app/src/main/jni/MainComponentsRegistry.cpp +65 -0
- package/exampleForExpo/android/app/src/main/jni/MainComponentsRegistry.h +32 -0
- package/exampleForExpo/android/app/src/main/jni/OnLoad.cpp +11 -0
- package/exampleForExpo/android/app/src/main/res/drawable/rn_edit_text_material.xml +36 -0
- package/exampleForExpo/android/app/src/main/res/drawable/splashscreen.xml +4 -0
- package/exampleForExpo/android/app/src/main/res/mipmap-hdpi/ic_launcher.png +0 -0
- package/exampleForExpo/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png +0 -0
- package/exampleForExpo/android/app/src/main/res/mipmap-mdpi/ic_launcher.png +0 -0
- package/exampleForExpo/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png +0 -0
- package/exampleForExpo/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png +0 -0
- package/exampleForExpo/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png +0 -0
- package/exampleForExpo/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png +0 -0
- package/exampleForExpo/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png +0 -0
- package/exampleForExpo/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png +0 -0
- package/exampleForExpo/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png +0 -0
- package/exampleForExpo/android/app/src/main/res/values/colors.xml +4 -0
- package/exampleForExpo/android/app/src/main/res/values/strings.xml +3 -0
- package/exampleForExpo/android/app/src/main/res/values/styles.xml +17 -0
- package/exampleForExpo/android/app/src/main/res/values-night/colors.xml +1 -0
- package/exampleForExpo/android/build.gradle +65 -0
- package/exampleForExpo/android/gradle/wrapper/gradle-wrapper.jar +0 -0
- package/exampleForExpo/android/gradle/wrapper/gradle-wrapper.properties +5 -0
- package/exampleForExpo/android/gradle.properties +53 -0
- package/exampleForExpo/android/gradlew +240 -0
- package/exampleForExpo/android/gradlew.bat +91 -0
- package/exampleForExpo/android/settings.gradle +17 -0
- package/exampleForExpo/app.json +16 -0
- package/exampleForExpo/babel.config.js +11 -0
- package/exampleForExpo/index.js +9 -0
- package/exampleForExpo/ios/.gitignore +30 -0
- package/exampleForExpo/ios/.xcode.env +11 -0
- package/exampleForExpo/ios/Podfile +61 -0
- package/exampleForExpo/ios/Podfile.lock +734 -0
- package/exampleForExpo/ios/Podfile.properties.json +3 -0
- package/exampleForExpo/ios/exampleForExpo/AppDelegate.h +9 -0
- package/exampleForExpo/ios/exampleForExpo/AppDelegate.mm +166 -0
- package/exampleForExpo/ios/exampleForExpo/Images.xcassets/AppIcon.appiconset/Contents.json +38 -0
- package/exampleForExpo/ios/exampleForExpo/Images.xcassets/Contents.json +6 -0
- package/exampleForExpo/ios/exampleForExpo/Images.xcassets/SplashScreenBackground.imageset/Contents.json +21 -0
- package/exampleForExpo/ios/exampleForExpo/Images.xcassets/SplashScreenBackground.imageset/image.png +0 -0
- package/exampleForExpo/ios/exampleForExpo/Info.plist +118 -0
- package/exampleForExpo/ios/exampleForExpo/SplashScreen.storyboard +43 -0
- package/exampleForExpo/ios/exampleForExpo/Supporting/Expo.plist +16 -0
- package/exampleForExpo/ios/exampleForExpo/exampleForExpo.entitlements +8 -0
- package/exampleForExpo/ios/exampleForExpo/main.m +10 -0
- package/exampleForExpo/ios/exampleForExpo/noop-file.swift +4 -0
- package/exampleForExpo/ios/exampleForExpo.xcodeproj/project.pbxproj +544 -0
- package/exampleForExpo/ios/exampleForExpo.xcodeproj/xcshareddata/xcschemes/exampleForExpo.xcscheme +88 -0
- package/exampleForExpo/ios/exampleForExpo.xcworkspace/contents.xcworkspacedata +10 -0
- package/exampleForExpo/ios/exampleForExpo.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +8 -0
- package/exampleForExpo/metro.config.js +62 -0
- package/exampleForExpo/package.json +40 -0
- package/exampleForExpo/src/App.js +14 -0
- package/exampleForExpo/src/Certification/index.js +25 -0
- package/exampleForExpo/src/CertificationResult/index.js +61 -0
- package/exampleForExpo/src/CertificationTest/index.js +151 -0
- package/exampleForExpo/src/Home/index.js +80 -0
- package/exampleForExpo/src/Loading/index.js +10 -0
- package/exampleForExpo/src/NavigationService.js +102 -0
- package/exampleForExpo/src/Payment/index.js +23 -0
- package/exampleForExpo/src/PaymentResult/index.js +82 -0
- package/exampleForExpo/src/PaymentTest/index.js +313 -0
- package/exampleForExpo/src/Picker/index.js +19 -0
- package/exampleForExpo/src/constants.js +322 -0
- package/exampleForExpo/src/utils.js +116 -0
- package/exampleForExpo/yarn.lock +9498 -0
- package/exampleForManagedExpo/.expo-shared/assets.json +4 -0
- package/exampleForManagedExpo/.gitignore +22 -0
- package/exampleForManagedExpo/App.js +11 -0
- package/exampleForManagedExpo/README.md +33 -0
- package/exampleForManagedExpo/app.json +90 -0
- package/exampleForManagedExpo/assets/adaptive-icon.png +0 -0
- package/exampleForManagedExpo/assets/favicon.png +0 -0
- package/exampleForManagedExpo/assets/icon.png +0 -0
- package/exampleForManagedExpo/assets/splash.png +0 -0
- package/exampleForManagedExpo/babel.config.js +11 -0
- package/exampleForManagedExpo/metro.config.js +62 -0
- package/exampleForManagedExpo/package.json +36 -0
- package/exampleForManagedExpo/src/Certification/index.js +25 -0
- package/exampleForManagedExpo/src/CertificationResult/index.js +61 -0
- package/exampleForManagedExpo/src/CertificationTest/index.js +151 -0
- package/exampleForManagedExpo/src/Home/index.js +80 -0
- package/exampleForManagedExpo/src/Loading/index.js +10 -0
- package/exampleForManagedExpo/src/NavigationService.js +102 -0
- package/exampleForManagedExpo/src/Payment/index.js +23 -0
- package/exampleForManagedExpo/src/PaymentResult/index.js +82 -0
- package/exampleForManagedExpo/src/PaymentTest/index.js +313 -0
- package/exampleForManagedExpo/src/Picker/index.js +19 -0
- package/exampleForManagedExpo/src/constants.js +322 -0
- package/exampleForManagedExpo/src/utils.js +116 -0
- package/exampleForManagedExpo/yarn.lock +9411 -0
- package/exampleForWebView/.buckconfig +6 -0
- package/exampleForWebView/.eslintrc.js +4 -0
- package/exampleForWebView/.gitattributes +3 -0
- package/exampleForWebView/.gitignore +68 -0
- package/exampleForWebView/.prettierrc.js +7 -0
- package/exampleForWebView/.watchmanconfig +1 -0
- package/exampleForWebView/README.md +77 -0
- package/exampleForWebView/__tests__/App-test.tsx +14 -0
- package/exampleForWebView/_editorconfig +3 -0
- package/exampleForWebView/android/.gradle/7.5.1/checksums/checksums.lock +0 -0
- package/exampleForWebView/android/.gradle/7.5.1/fileChanges/last-build.bin +0 -0
- package/exampleForWebView/android/.gradle/7.5.1/fileHashes/fileHashes.lock +0 -0
- package/exampleForWebView/android/.gradle/7.5.1/gc.properties +0 -0
- package/exampleForWebView/android/.gradle/vcs-1/gc.properties +0 -0
- package/exampleForWebView/android/app/BUCK +55 -0
- package/exampleForWebView/android/app/build.gradle +313 -0
- package/exampleForWebView/android/app/build_defs.bzl +19 -0
- package/exampleForWebView/android/app/debug.keystore +0 -0
- package/exampleForWebView/android/app/proguard-rules.pro +10 -0
- package/exampleForWebView/android/app/src/debug/AndroidManifest.xml +13 -0
- package/exampleForWebView/android/app/src/debug/java/com/exampleforwebview/ReactNativeFlipper.java +73 -0
- package/exampleForWebView/android/app/src/main/AndroidManifest.xml +26 -0
- package/exampleForWebView/android/app/src/main/java/com/exampleforwebview/MainActivity.java +48 -0
- package/exampleForWebView/android/app/src/main/java/com/exampleforwebview/MainApplication.java +91 -0
- package/exampleForWebView/android/app/src/main/java/com/exampleforwebview/newarchitecture/MainApplicationReactNativeHost.java +116 -0
- package/exampleForWebView/android/app/src/main/java/com/exampleforwebview/newarchitecture/components/MainComponentsRegistry.java +36 -0
- package/exampleForWebView/android/app/src/main/java/com/exampleforwebview/newarchitecture/modules/MainApplicationTurboModuleManagerDelegate.java +48 -0
- package/exampleForWebView/android/app/src/main/jni/CMakeLists.txt +7 -0
- package/exampleForWebView/android/app/src/main/jni/MainApplicationModuleProvider.cpp +32 -0
- package/exampleForWebView/android/app/src/main/jni/MainApplicationModuleProvider.h +16 -0
- package/exampleForWebView/android/app/src/main/jni/MainApplicationTurboModuleManagerDelegate.cpp +45 -0
- package/exampleForWebView/android/app/src/main/jni/MainApplicationTurboModuleManagerDelegate.h +38 -0
- package/exampleForWebView/android/app/src/main/jni/MainComponentsRegistry.cpp +65 -0
- package/exampleForWebView/android/app/src/main/jni/MainComponentsRegistry.h +32 -0
- package/exampleForWebView/android/app/src/main/jni/OnLoad.cpp +11 -0
- package/exampleForWebView/android/app/src/main/res/drawable/rn_edit_text_material.xml +36 -0
- package/exampleForWebView/android/app/src/main/res/mipmap-hdpi/ic_launcher.png +0 -0
- package/exampleForWebView/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png +0 -0
- package/exampleForWebView/android/app/src/main/res/mipmap-mdpi/ic_launcher.png +0 -0
- package/exampleForWebView/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png +0 -0
- package/exampleForWebView/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png +0 -0
- package/exampleForWebView/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png +0 -0
- package/exampleForWebView/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png +0 -0
- package/exampleForWebView/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png +0 -0
- package/exampleForWebView/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png +0 -0
- package/exampleForWebView/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png +0 -0
- package/exampleForWebView/android/app/src/main/res/values/strings.xml +3 -0
- package/exampleForWebView/android/app/src/main/res/values/styles.xml +9 -0
- package/exampleForWebView/android/build.gradle +51 -0
- package/exampleForWebView/android/gradle/wrapper/gradle-wrapper.jar +0 -0
- package/exampleForWebView/android/gradle/wrapper/gradle-wrapper.properties +5 -0
- package/exampleForWebView/android/gradle.properties +40 -0
- package/exampleForWebView/android/gradlew +234 -0
- package/exampleForWebView/android/gradlew.bat +89 -0
- package/exampleForWebView/android/settings.gradle +11 -0
- package/exampleForWebView/app.json +4 -0
- package/exampleForWebView/babel.config.js +11 -0
- package/exampleForWebView/index.js +9 -0
- package/exampleForWebView/ios/.xcode.env +11 -0
- package/exampleForWebView/ios/Podfile +43 -0
- package/exampleForWebView/ios/Podfile.lock +748 -0
- package/exampleForWebView/ios/exampleForWebView/AppDelegate.h +8 -0
- package/exampleForWebView/ios/exampleForWebView/AppDelegate.mm +133 -0
- package/exampleForWebView/ios/exampleForWebView/Images.xcassets/AppIcon.appiconset/Contents.json +53 -0
- package/exampleForWebView/ios/exampleForWebView/Images.xcassets/Contents.json +6 -0
- package/exampleForWebView/ios/exampleForWebView/Info.plist +96 -0
- package/exampleForWebView/ios/exampleForWebView/LaunchScreen.storyboard +47 -0
- package/exampleForWebView/ios/exampleForWebView/main.m +10 -0
- package/exampleForWebView/ios/exampleForWebView.xcodeproj/project.pbxproj +723 -0
- package/exampleForWebView/ios/exampleForWebView.xcodeproj/xcshareddata/xcschemes/exampleForWebView.xcscheme +88 -0
- package/exampleForWebView/ios/exampleForWebView.xcworkspace/contents.xcworkspacedata +10 -0
- package/exampleForWebView/ios/exampleForWebView.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +8 -0
- package/exampleForWebView/ios/exampleForWebViewTests/Info.plist +24 -0
- package/exampleForWebView/ios/exampleForWebViewTests/exampleForWebViewTests.m +66 -0
- package/exampleForWebView/manuals/CERTIFICATION.md +223 -0
- package/exampleForWebView/manuals/PAYMENT.md +232 -0
- package/exampleForWebView/metro.config.js +61 -0
- package/exampleForWebView/package.json +54 -0
- package/exampleForWebView/src/App.tsx +50 -0
- package/exampleForWebView/src/Certification.tsx +54 -0
- package/exampleForWebView/src/Home.tsx +49 -0
- package/exampleForWebView/src/Loading.tsx +23 -0
- package/exampleForWebView/src/Payment.tsx +65 -0
- package/exampleForWebView/yarn.lock +7362 -0
- package/lib/commonjs/components/Certification/index.js +10 -13
- package/lib/commonjs/components/Certification/index.js.map +1 -1
- package/lib/commonjs/components/ErrorOnParams/index.js +5 -7
- package/lib/commonjs/components/ErrorOnParams/index.js.map +1 -1
- package/lib/commonjs/components/Loading/index.js +2 -3
- package/lib/commonjs/components/Loading/index.js.map +1 -1
- package/lib/commonjs/components/Payment/index.js +10 -13
- package/lib/commonjs/components/Payment/index.js.map +1 -1
- package/lib/commonjs/constants/index.js +2 -4
- package/lib/commonjs/constants/index.js.map +1 -1
- package/lib/commonjs/index.js +2 -3
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/styles.js +1 -2
- package/lib/commonjs/styles.js.map +1 -1
- package/lib/commonjs/utils/IamportUrl.js +2 -3
- package/lib/commonjs/utils/IamportUrl.js.map +1 -1
- package/lib/commonjs/utils/Validation.js +1 -2
- package/lib/commonjs/utils/Validation.js.map +1 -1
- package/lib/commonjs/utils/ValidationForPayment.js +1 -2
- package/lib/commonjs/utils/ValidationForPayment.js.map +1 -1
- package/lib/module/components/Certification/index.js +7 -8
- package/lib/module/components/Certification/index.js.map +1 -1
- package/lib/module/components/ErrorOnParams/index.js +3 -4
- package/lib/module/components/ErrorOnParams/index.js.map +1 -1
- package/lib/module/components/Loading/index.js.map +1 -1
- package/lib/module/components/Payment/index.js +7 -8
- package/lib/module/components/Payment/index.js.map +1 -1
- package/lib/module/constants/index.js +1 -2
- package/lib/module/constants/index.js.map +1 -1
- package/lib/module/index.js.map +1 -1
- package/lib/module/styles.js.map +1 -1
- package/lib/module/utils/IamportUrl.js.map +1 -1
- package/lib/module/utils/Validation.js.map +1 -1
- package/lib/module/utils/ValidationForPayment.js.map +1 -1
- package/lib/typescript/constants/index.d.ts +1 -1
- package/lib/typescript/constants/index.d.ts.map +1 -1
- package/manuals/CALLBACK.md +72 -0
- package/manuals/EXAMPLE.md +168 -0
- package/manuals/EXPO.md +246 -0
- package/manuals/INSTALL.md +31 -0
- package/manuals/SETTING.md +140 -0
- package/manuals/SUPPORT.md +35 -0
- package/manuals/TRANS.md +77 -0
- package/manuals/VERSION.md +184 -0
- package/manuals/assets/after-linking-iamport.png +0 -0
- package/manuals/assets/after-linking-webview.png +0 -0
- package/manuals/assets/allow-arbitrary.gif +0 -0
- package/manuals/assets/android-studio-avd-manager.png +0 -0
- package/manuals/assets/android-studio-build.png +0 -0
- package/manuals/assets/app-scheme-registry.gif +0 -0
- package/manuals/assets/expo-eject.png +0 -0
- package/manuals/assets/ios-emulator-certification.png +0 -0
- package/manuals/assets/ios-emulator-home.png +0 -0
- package/manuals/assets/ios-emulator-payment.png +0 -0
- package/manuals/assets/ios-trans-create-header-file-1.png +0 -0
- package/manuals/assets/ios-trans-create-header-file-2.png +0 -0
- package/manuals/assets/ios-trans-create-objectivec-file-1.png +0 -0
- package/manuals/assets/ios-trans-create-objectivec-file-2.png +0 -0
- package/manuals/assets/ios-trans-result.png +0 -0
- package/manuals/assets/webview-peer-dependency.png +0 -0
- package/package.json +3 -2
- package/scripts/bootstrap.js +24 -0
- package/src/constants/index.ts +8 -0
- package/tsconfig.build.json +9 -0
- package/tsconfig.json +26 -0
- package/yarn.lock +6174 -0
package/exampleForWebView/android/app/src/debug/java/com/exampleforwebview/ReactNativeFlipper.java
ADDED
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
+
*
|
|
4
|
+
* <p>This source code is licensed under the MIT license found in the LICENSE file in the root
|
|
5
|
+
* directory of this source tree.
|
|
6
|
+
*/
|
|
7
|
+
package com.exampleforwebview;
|
|
8
|
+
|
|
9
|
+
import android.content.Context;
|
|
10
|
+
import com.facebook.flipper.android.AndroidFlipperClient;
|
|
11
|
+
import com.facebook.flipper.android.utils.FlipperUtils;
|
|
12
|
+
import com.facebook.flipper.core.FlipperClient;
|
|
13
|
+
import com.facebook.flipper.plugins.crashreporter.CrashReporterPlugin;
|
|
14
|
+
import com.facebook.flipper.plugins.databases.DatabasesFlipperPlugin;
|
|
15
|
+
import com.facebook.flipper.plugins.fresco.FrescoFlipperPlugin;
|
|
16
|
+
import com.facebook.flipper.plugins.inspector.DescriptorMapping;
|
|
17
|
+
import com.facebook.flipper.plugins.inspector.InspectorFlipperPlugin;
|
|
18
|
+
import com.facebook.flipper.plugins.network.FlipperOkhttpInterceptor;
|
|
19
|
+
import com.facebook.flipper.plugins.network.NetworkFlipperPlugin;
|
|
20
|
+
import com.facebook.flipper.plugins.react.ReactFlipperPlugin;
|
|
21
|
+
import com.facebook.flipper.plugins.sharedpreferences.SharedPreferencesFlipperPlugin;
|
|
22
|
+
import com.facebook.react.ReactInstanceEventListener;
|
|
23
|
+
import com.facebook.react.ReactInstanceManager;
|
|
24
|
+
import com.facebook.react.bridge.ReactContext;
|
|
25
|
+
import com.facebook.react.modules.network.NetworkingModule;
|
|
26
|
+
import okhttp3.OkHttpClient;
|
|
27
|
+
|
|
28
|
+
public class ReactNativeFlipper {
|
|
29
|
+
public static void initializeFlipper(Context context, ReactInstanceManager reactInstanceManager) {
|
|
30
|
+
if (FlipperUtils.shouldEnableFlipper(context)) {
|
|
31
|
+
final FlipperClient client = AndroidFlipperClient.getInstance(context);
|
|
32
|
+
|
|
33
|
+
client.addPlugin(new InspectorFlipperPlugin(context, DescriptorMapping.withDefaults()));
|
|
34
|
+
client.addPlugin(new ReactFlipperPlugin());
|
|
35
|
+
client.addPlugin(new DatabasesFlipperPlugin(context));
|
|
36
|
+
client.addPlugin(new SharedPreferencesFlipperPlugin(context));
|
|
37
|
+
client.addPlugin(CrashReporterPlugin.getInstance());
|
|
38
|
+
|
|
39
|
+
NetworkFlipperPlugin networkFlipperPlugin = new NetworkFlipperPlugin();
|
|
40
|
+
NetworkingModule.setCustomClientBuilder(
|
|
41
|
+
new NetworkingModule.CustomClientBuilder() {
|
|
42
|
+
@Override
|
|
43
|
+
public void apply(OkHttpClient.Builder builder) {
|
|
44
|
+
builder.addNetworkInterceptor(new FlipperOkhttpInterceptor(networkFlipperPlugin));
|
|
45
|
+
}
|
|
46
|
+
});
|
|
47
|
+
client.addPlugin(networkFlipperPlugin);
|
|
48
|
+
client.start();
|
|
49
|
+
|
|
50
|
+
// Fresco Plugin needs to ensure that ImagePipelineFactory is initialized
|
|
51
|
+
// Hence we run if after all native modules have been initialized
|
|
52
|
+
ReactContext reactContext = reactInstanceManager.getCurrentReactContext();
|
|
53
|
+
if (reactContext == null) {
|
|
54
|
+
reactInstanceManager.addReactInstanceEventListener(
|
|
55
|
+
new ReactInstanceEventListener() {
|
|
56
|
+
@Override
|
|
57
|
+
public void onReactContextInitialized(ReactContext reactContext) {
|
|
58
|
+
reactInstanceManager.removeReactInstanceEventListener(this);
|
|
59
|
+
reactContext.runOnNativeModulesQueueThread(
|
|
60
|
+
new Runnable() {
|
|
61
|
+
@Override
|
|
62
|
+
public void run() {
|
|
63
|
+
client.addPlugin(new FrescoFlipperPlugin());
|
|
64
|
+
}
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
});
|
|
68
|
+
} else {
|
|
69
|
+
client.addPlugin(new FrescoFlipperPlugin());
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
|
2
|
+
package="com.exampleforwebview">
|
|
3
|
+
|
|
4
|
+
<uses-permission android:name="android.permission.INTERNET" />
|
|
5
|
+
|
|
6
|
+
<application
|
|
7
|
+
android:name=".MainApplication"
|
|
8
|
+
android:label="@string/app_name"
|
|
9
|
+
android:icon="@mipmap/ic_launcher"
|
|
10
|
+
android:roundIcon="@mipmap/ic_launcher_round"
|
|
11
|
+
android:allowBackup="false"
|
|
12
|
+
android:theme="@style/AppTheme">
|
|
13
|
+
<activity
|
|
14
|
+
android:name=".MainActivity"
|
|
15
|
+
android:label="@string/app_name"
|
|
16
|
+
android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|screenSize|smallestScreenSize|uiMode"
|
|
17
|
+
android:launchMode="singleTask"
|
|
18
|
+
android:windowSoftInputMode="adjustResize"
|
|
19
|
+
android:exported="true">
|
|
20
|
+
<intent-filter>
|
|
21
|
+
<action android:name="android.intent.action.MAIN" />
|
|
22
|
+
<category android:name="android.intent.category.LAUNCHER" />
|
|
23
|
+
</intent-filter>
|
|
24
|
+
</activity>
|
|
25
|
+
</application>
|
|
26
|
+
</manifest>
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
package com.exampleforwebview;
|
|
2
|
+
|
|
3
|
+
import com.facebook.react.ReactActivity;
|
|
4
|
+
import com.facebook.react.ReactActivityDelegate;
|
|
5
|
+
import com.facebook.react.ReactRootView;
|
|
6
|
+
|
|
7
|
+
public class MainActivity extends ReactActivity {
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Returns the name of the main component registered from JavaScript. This is used to schedule
|
|
11
|
+
* rendering of the component.
|
|
12
|
+
*/
|
|
13
|
+
@Override
|
|
14
|
+
protected String getMainComponentName() {
|
|
15
|
+
return "exampleForWebView";
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Returns the instance of the {@link ReactActivityDelegate}. There the RootView is created and
|
|
20
|
+
* you can specify the renderer you wish to use - the new renderer (Fabric) or the old renderer
|
|
21
|
+
* (Paper).
|
|
22
|
+
*/
|
|
23
|
+
@Override
|
|
24
|
+
protected ReactActivityDelegate createReactActivityDelegate() {
|
|
25
|
+
return new MainActivityDelegate(this, getMainComponentName());
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
public static class MainActivityDelegate extends ReactActivityDelegate {
|
|
29
|
+
public MainActivityDelegate(ReactActivity activity, String mainComponentName) {
|
|
30
|
+
super(activity, mainComponentName);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
@Override
|
|
34
|
+
protected ReactRootView createRootView() {
|
|
35
|
+
ReactRootView reactRootView = new ReactRootView(getContext());
|
|
36
|
+
// If you opted-in for the New Architecture, we enable the Fabric Renderer.
|
|
37
|
+
reactRootView.setIsFabric(BuildConfig.IS_NEW_ARCHITECTURE_ENABLED);
|
|
38
|
+
return reactRootView;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
@Override
|
|
42
|
+
protected boolean isConcurrentRootEnabled() {
|
|
43
|
+
// If you opted-in for the New Architecture, we enable Concurrent Root (i.e. React 18).
|
|
44
|
+
// More on this on https://reactjs.org/blog/2022/03/29/react-v18.html
|
|
45
|
+
return BuildConfig.IS_NEW_ARCHITECTURE_ENABLED;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}
|
package/exampleForWebView/android/app/src/main/java/com/exampleforwebview/MainApplication.java
ADDED
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
package com.exampleforwebview;
|
|
2
|
+
|
|
3
|
+
import android.app.Application;
|
|
4
|
+
import android.content.Context;
|
|
5
|
+
import com.facebook.react.PackageList;
|
|
6
|
+
import com.facebook.react.ReactApplication;
|
|
7
|
+
import com.facebook.react.ReactInstanceManager;
|
|
8
|
+
import com.facebook.react.ReactNativeHost;
|
|
9
|
+
import com.facebook.react.ReactPackage;
|
|
10
|
+
import com.facebook.react.config.ReactFeatureFlags;
|
|
11
|
+
import com.facebook.soloader.SoLoader;
|
|
12
|
+
import com.exampleforwebview.newarchitecture.MainApplicationReactNativeHost;
|
|
13
|
+
import java.lang.reflect.InvocationTargetException;
|
|
14
|
+
import java.util.List;
|
|
15
|
+
|
|
16
|
+
public class MainApplication extends Application implements ReactApplication {
|
|
17
|
+
|
|
18
|
+
private final ReactNativeHost mReactNativeHost =
|
|
19
|
+
new ReactNativeHost(this) {
|
|
20
|
+
@Override
|
|
21
|
+
public boolean getUseDeveloperSupport() {
|
|
22
|
+
return BuildConfig.DEBUG;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
@Override
|
|
26
|
+
protected List<ReactPackage> getPackages() {
|
|
27
|
+
@SuppressWarnings("UnnecessaryLocalVariable")
|
|
28
|
+
List<ReactPackage> packages = new PackageList(this).getPackages();
|
|
29
|
+
// Packages that cannot be autolinked yet can be added manually here, for example:
|
|
30
|
+
// packages.add(new MyReactNativePackage());
|
|
31
|
+
return packages;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
@Override
|
|
35
|
+
protected String getJSMainModuleName() {
|
|
36
|
+
return "index";
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
private final ReactNativeHost mNewArchitectureNativeHost =
|
|
41
|
+
new MainApplicationReactNativeHost(this);
|
|
42
|
+
|
|
43
|
+
@Override
|
|
44
|
+
public ReactNativeHost getReactNativeHost() {
|
|
45
|
+
if (BuildConfig.IS_NEW_ARCHITECTURE_ENABLED) {
|
|
46
|
+
return mNewArchitectureNativeHost;
|
|
47
|
+
} else {
|
|
48
|
+
return mReactNativeHost;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
@Override
|
|
53
|
+
public void onCreate() {
|
|
54
|
+
super.onCreate();
|
|
55
|
+
// If you opted-in for the New Architecture, we enable the TurboModule system
|
|
56
|
+
ReactFeatureFlags.useTurboModules = BuildConfig.IS_NEW_ARCHITECTURE_ENABLED;
|
|
57
|
+
SoLoader.init(this, /* native exopackage */ false);
|
|
58
|
+
initializeFlipper(this, getReactNativeHost().getReactInstanceManager());
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* Loads Flipper in React Native templates. Call this in the onCreate method with something like
|
|
63
|
+
* initializeFlipper(this, getReactNativeHost().getReactInstanceManager());
|
|
64
|
+
*
|
|
65
|
+
* @param context
|
|
66
|
+
* @param reactInstanceManager
|
|
67
|
+
*/
|
|
68
|
+
private static void initializeFlipper(
|
|
69
|
+
Context context, ReactInstanceManager reactInstanceManager) {
|
|
70
|
+
if (BuildConfig.DEBUG) {
|
|
71
|
+
try {
|
|
72
|
+
/*
|
|
73
|
+
We use reflection here to pick up the class that initializes Flipper,
|
|
74
|
+
since Flipper library is not available in release mode
|
|
75
|
+
*/
|
|
76
|
+
Class<?> aClass = Class.forName("com.exampleforwebview.ReactNativeFlipper");
|
|
77
|
+
aClass
|
|
78
|
+
.getMethod("initializeFlipper", Context.class, ReactInstanceManager.class)
|
|
79
|
+
.invoke(null, context, reactInstanceManager);
|
|
80
|
+
} catch (ClassNotFoundException e) {
|
|
81
|
+
e.printStackTrace();
|
|
82
|
+
} catch (NoSuchMethodException e) {
|
|
83
|
+
e.printStackTrace();
|
|
84
|
+
} catch (IllegalAccessException e) {
|
|
85
|
+
e.printStackTrace();
|
|
86
|
+
} catch (InvocationTargetException e) {
|
|
87
|
+
e.printStackTrace();
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
}
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
package com.exampleforwebview.newarchitecture;
|
|
2
|
+
|
|
3
|
+
import android.app.Application;
|
|
4
|
+
import androidx.annotation.NonNull;
|
|
5
|
+
import com.facebook.react.PackageList;
|
|
6
|
+
import com.facebook.react.ReactInstanceManager;
|
|
7
|
+
import com.facebook.react.ReactNativeHost;
|
|
8
|
+
import com.facebook.react.ReactPackage;
|
|
9
|
+
import com.facebook.react.ReactPackageTurboModuleManagerDelegate;
|
|
10
|
+
import com.facebook.react.bridge.JSIModulePackage;
|
|
11
|
+
import com.facebook.react.bridge.JSIModuleProvider;
|
|
12
|
+
import com.facebook.react.bridge.JSIModuleSpec;
|
|
13
|
+
import com.facebook.react.bridge.JSIModuleType;
|
|
14
|
+
import com.facebook.react.bridge.JavaScriptContextHolder;
|
|
15
|
+
import com.facebook.react.bridge.ReactApplicationContext;
|
|
16
|
+
import com.facebook.react.bridge.UIManager;
|
|
17
|
+
import com.facebook.react.fabric.ComponentFactory;
|
|
18
|
+
import com.facebook.react.fabric.CoreComponentsRegistry;
|
|
19
|
+
import com.facebook.react.fabric.FabricJSIModuleProvider;
|
|
20
|
+
import com.facebook.react.fabric.ReactNativeConfig;
|
|
21
|
+
import com.facebook.react.uimanager.ViewManagerRegistry;
|
|
22
|
+
import com.exampleforwebview.BuildConfig;
|
|
23
|
+
import com.exampleforwebview.newarchitecture.components.MainComponentsRegistry;
|
|
24
|
+
import com.exampleforwebview.newarchitecture.modules.MainApplicationTurboModuleManagerDelegate;
|
|
25
|
+
import java.util.ArrayList;
|
|
26
|
+
import java.util.List;
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* A {@link ReactNativeHost} that helps you load everything needed for the New Architecture, both
|
|
30
|
+
* TurboModule delegates and the Fabric Renderer.
|
|
31
|
+
*
|
|
32
|
+
* <p>Please note that this class is used ONLY if you opt-in for the New Architecture (see the
|
|
33
|
+
* `newArchEnabled` property). Is ignored otherwise.
|
|
34
|
+
*/
|
|
35
|
+
public class MainApplicationReactNativeHost extends ReactNativeHost {
|
|
36
|
+
public MainApplicationReactNativeHost(Application application) {
|
|
37
|
+
super(application);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
@Override
|
|
41
|
+
public boolean getUseDeveloperSupport() {
|
|
42
|
+
return BuildConfig.DEBUG;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
@Override
|
|
46
|
+
protected List<ReactPackage> getPackages() {
|
|
47
|
+
List<ReactPackage> packages = new PackageList(this).getPackages();
|
|
48
|
+
// Packages that cannot be autolinked yet can be added manually here, for example:
|
|
49
|
+
// packages.add(new MyReactNativePackage());
|
|
50
|
+
// TurboModules must also be loaded here providing a valid TurboReactPackage implementation:
|
|
51
|
+
// packages.add(new TurboReactPackage() { ... });
|
|
52
|
+
// If you have custom Fabric Components, their ViewManagers should also be loaded here
|
|
53
|
+
// inside a ReactPackage.
|
|
54
|
+
return packages;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
@Override
|
|
58
|
+
protected String getJSMainModuleName() {
|
|
59
|
+
return "index";
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
@NonNull
|
|
63
|
+
@Override
|
|
64
|
+
protected ReactPackageTurboModuleManagerDelegate.Builder
|
|
65
|
+
getReactPackageTurboModuleManagerDelegateBuilder() {
|
|
66
|
+
// Here we provide the ReactPackageTurboModuleManagerDelegate Builder. This is necessary
|
|
67
|
+
// for the new architecture and to use TurboModules correctly.
|
|
68
|
+
return new MainApplicationTurboModuleManagerDelegate.Builder();
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
@Override
|
|
72
|
+
protected JSIModulePackage getJSIModulePackage() {
|
|
73
|
+
return new JSIModulePackage() {
|
|
74
|
+
@Override
|
|
75
|
+
public List<JSIModuleSpec> getJSIModules(
|
|
76
|
+
final ReactApplicationContext reactApplicationContext,
|
|
77
|
+
final JavaScriptContextHolder jsContext) {
|
|
78
|
+
final List<JSIModuleSpec> specs = new ArrayList<>();
|
|
79
|
+
|
|
80
|
+
// Here we provide a new JSIModuleSpec that will be responsible of providing the
|
|
81
|
+
// custom Fabric Components.
|
|
82
|
+
specs.add(
|
|
83
|
+
new JSIModuleSpec() {
|
|
84
|
+
@Override
|
|
85
|
+
public JSIModuleType getJSIModuleType() {
|
|
86
|
+
return JSIModuleType.UIManager;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
@Override
|
|
90
|
+
public JSIModuleProvider<UIManager> getJSIModuleProvider() {
|
|
91
|
+
final ComponentFactory componentFactory = new ComponentFactory();
|
|
92
|
+
CoreComponentsRegistry.register(componentFactory);
|
|
93
|
+
|
|
94
|
+
// Here we register a Components Registry.
|
|
95
|
+
// The one that is generated with the template contains no components
|
|
96
|
+
// and just provides you the one from React Native core.
|
|
97
|
+
MainComponentsRegistry.register(componentFactory);
|
|
98
|
+
|
|
99
|
+
final ReactInstanceManager reactInstanceManager = getReactInstanceManager();
|
|
100
|
+
|
|
101
|
+
ViewManagerRegistry viewManagerRegistry =
|
|
102
|
+
new ViewManagerRegistry(
|
|
103
|
+
reactInstanceManager.getOrCreateViewManagers(reactApplicationContext));
|
|
104
|
+
|
|
105
|
+
return new FabricJSIModuleProvider(
|
|
106
|
+
reactApplicationContext,
|
|
107
|
+
componentFactory,
|
|
108
|
+
ReactNativeConfig.DEFAULT_CONFIG,
|
|
109
|
+
viewManagerRegistry);
|
|
110
|
+
}
|
|
111
|
+
});
|
|
112
|
+
return specs;
|
|
113
|
+
}
|
|
114
|
+
};
|
|
115
|
+
}
|
|
116
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
package com.exampleforwebview.newarchitecture.components;
|
|
2
|
+
|
|
3
|
+
import com.facebook.jni.HybridData;
|
|
4
|
+
import com.facebook.proguard.annotations.DoNotStrip;
|
|
5
|
+
import com.facebook.react.fabric.ComponentFactory;
|
|
6
|
+
import com.facebook.soloader.SoLoader;
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Class responsible to load the custom Fabric Components. This class has native methods and needs a
|
|
10
|
+
* corresponding C++ implementation/header file to work correctly (already placed inside the jni/
|
|
11
|
+
* folder for you).
|
|
12
|
+
*
|
|
13
|
+
* <p>Please note that this class is used ONLY if you opt-in for the New Architecture (see the
|
|
14
|
+
* `newArchEnabled` property). Is ignored otherwise.
|
|
15
|
+
*/
|
|
16
|
+
@DoNotStrip
|
|
17
|
+
public class MainComponentsRegistry {
|
|
18
|
+
static {
|
|
19
|
+
SoLoader.loadLibrary("fabricjni");
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
@DoNotStrip private final HybridData mHybridData;
|
|
23
|
+
|
|
24
|
+
@DoNotStrip
|
|
25
|
+
private native HybridData initHybrid(ComponentFactory componentFactory);
|
|
26
|
+
|
|
27
|
+
@DoNotStrip
|
|
28
|
+
private MainComponentsRegistry(ComponentFactory componentFactory) {
|
|
29
|
+
mHybridData = initHybrid(componentFactory);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
@DoNotStrip
|
|
33
|
+
public static MainComponentsRegistry register(ComponentFactory componentFactory) {
|
|
34
|
+
return new MainComponentsRegistry(componentFactory);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
package com.exampleforwebview.newarchitecture.modules;
|
|
2
|
+
|
|
3
|
+
import com.facebook.jni.HybridData;
|
|
4
|
+
import com.facebook.react.ReactPackage;
|
|
5
|
+
import com.facebook.react.ReactPackageTurboModuleManagerDelegate;
|
|
6
|
+
import com.facebook.react.bridge.ReactApplicationContext;
|
|
7
|
+
import com.facebook.soloader.SoLoader;
|
|
8
|
+
import java.util.List;
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Class responsible to load the TurboModules. This class has native methods and needs a
|
|
12
|
+
* corresponding C++ implementation/header file to work correctly (already placed inside the jni/
|
|
13
|
+
* folder for you).
|
|
14
|
+
*
|
|
15
|
+
* <p>Please note that this class is used ONLY if you opt-in for the New Architecture (see the
|
|
16
|
+
* `newArchEnabled` property). Is ignored otherwise.
|
|
17
|
+
*/
|
|
18
|
+
public class MainApplicationTurboModuleManagerDelegate
|
|
19
|
+
extends ReactPackageTurboModuleManagerDelegate {
|
|
20
|
+
|
|
21
|
+
private static volatile boolean sIsSoLibraryLoaded;
|
|
22
|
+
|
|
23
|
+
protected MainApplicationTurboModuleManagerDelegate(
|
|
24
|
+
ReactApplicationContext reactApplicationContext, List<ReactPackage> packages) {
|
|
25
|
+
super(reactApplicationContext, packages);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
protected native HybridData initHybrid();
|
|
29
|
+
|
|
30
|
+
native boolean canCreateTurboModule(String moduleName);
|
|
31
|
+
|
|
32
|
+
public static class Builder extends ReactPackageTurboModuleManagerDelegate.Builder {
|
|
33
|
+
protected MainApplicationTurboModuleManagerDelegate build(
|
|
34
|
+
ReactApplicationContext context, List<ReactPackage> packages) {
|
|
35
|
+
return new MainApplicationTurboModuleManagerDelegate(context, packages);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
@Override
|
|
40
|
+
protected synchronized void maybeLoadOtherSoLibraries() {
|
|
41
|
+
if (!sIsSoLibraryLoaded) {
|
|
42
|
+
// If you change the name of your application .so file in the Android.mk file,
|
|
43
|
+
// make sure you update the name here as well.
|
|
44
|
+
SoLoader.loadLibrary("exampleforwebview_appmodules");
|
|
45
|
+
sIsSoLibraryLoaded = true;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
cmake_minimum_required(VERSION 3.13)
|
|
2
|
+
|
|
3
|
+
# Define the library name here.
|
|
4
|
+
project(exampleforwebview_appmodules)
|
|
5
|
+
|
|
6
|
+
# This file includes all the necessary to let you build your application with the New Architecture.
|
|
7
|
+
include(${REACT_ANDROID_DIR}/cmake-utils/ReactNative-application.cmake)
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
#include "MainApplicationModuleProvider.h"
|
|
2
|
+
|
|
3
|
+
#include <rncli.h>
|
|
4
|
+
#include <rncore.h>
|
|
5
|
+
|
|
6
|
+
namespace facebook {
|
|
7
|
+
namespace react {
|
|
8
|
+
|
|
9
|
+
std::shared_ptr<TurboModule> MainApplicationModuleProvider(
|
|
10
|
+
const std::string &moduleName,
|
|
11
|
+
const JavaTurboModule::InitParams ¶ms) {
|
|
12
|
+
// Here you can provide your own module provider for TurboModules coming from
|
|
13
|
+
// either your application or from external libraries. The approach to follow
|
|
14
|
+
// is similar to the following (for a library called `samplelibrary`:
|
|
15
|
+
//
|
|
16
|
+
// auto module = samplelibrary_ModuleProvider(moduleName, params);
|
|
17
|
+
// if (module != nullptr) {
|
|
18
|
+
// return module;
|
|
19
|
+
// }
|
|
20
|
+
// return rncore_ModuleProvider(moduleName, params);
|
|
21
|
+
|
|
22
|
+
// Module providers autolinked by RN CLI
|
|
23
|
+
auto rncli_module = rncli_ModuleProvider(moduleName, params);
|
|
24
|
+
if (rncli_module != nullptr) {
|
|
25
|
+
return rncli_module;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
return rncore_ModuleProvider(moduleName, params);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
} // namespace react
|
|
32
|
+
} // namespace facebook
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
#pragma once
|
|
2
|
+
|
|
3
|
+
#include <memory>
|
|
4
|
+
#include <string>
|
|
5
|
+
|
|
6
|
+
#include <ReactCommon/JavaTurboModule.h>
|
|
7
|
+
|
|
8
|
+
namespace facebook {
|
|
9
|
+
namespace react {
|
|
10
|
+
|
|
11
|
+
std::shared_ptr<TurboModule> MainApplicationModuleProvider(
|
|
12
|
+
const std::string &moduleName,
|
|
13
|
+
const JavaTurboModule::InitParams ¶ms);
|
|
14
|
+
|
|
15
|
+
} // namespace react
|
|
16
|
+
} // namespace facebook
|
package/exampleForWebView/android/app/src/main/jni/MainApplicationTurboModuleManagerDelegate.cpp
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
#include "MainApplicationTurboModuleManagerDelegate.h"
|
|
2
|
+
#include "MainApplicationModuleProvider.h"
|
|
3
|
+
|
|
4
|
+
namespace facebook {
|
|
5
|
+
namespace react {
|
|
6
|
+
|
|
7
|
+
jni::local_ref<MainApplicationTurboModuleManagerDelegate::jhybriddata>
|
|
8
|
+
MainApplicationTurboModuleManagerDelegate::initHybrid(
|
|
9
|
+
jni::alias_ref<jhybridobject>) {
|
|
10
|
+
return makeCxxInstance();
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
void MainApplicationTurboModuleManagerDelegate::registerNatives() {
|
|
14
|
+
registerHybrid({
|
|
15
|
+
makeNativeMethod(
|
|
16
|
+
"initHybrid", MainApplicationTurboModuleManagerDelegate::initHybrid),
|
|
17
|
+
makeNativeMethod(
|
|
18
|
+
"canCreateTurboModule",
|
|
19
|
+
MainApplicationTurboModuleManagerDelegate::canCreateTurboModule),
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
std::shared_ptr<TurboModule>
|
|
24
|
+
MainApplicationTurboModuleManagerDelegate::getTurboModule(
|
|
25
|
+
const std::string &name,
|
|
26
|
+
const std::shared_ptr<CallInvoker> &jsInvoker) {
|
|
27
|
+
// Not implemented yet: provide pure-C++ NativeModules here.
|
|
28
|
+
return nullptr;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
std::shared_ptr<TurboModule>
|
|
32
|
+
MainApplicationTurboModuleManagerDelegate::getTurboModule(
|
|
33
|
+
const std::string &name,
|
|
34
|
+
const JavaTurboModule::InitParams ¶ms) {
|
|
35
|
+
return MainApplicationModuleProvider(name, params);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
bool MainApplicationTurboModuleManagerDelegate::canCreateTurboModule(
|
|
39
|
+
const std::string &name) {
|
|
40
|
+
return getTurboModule(name, nullptr) != nullptr ||
|
|
41
|
+
getTurboModule(name, {.moduleName = name}) != nullptr;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
} // namespace react
|
|
45
|
+
} // namespace facebook
|
package/exampleForWebView/android/app/src/main/jni/MainApplicationTurboModuleManagerDelegate.h
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
#include <memory>
|
|
2
|
+
#include <string>
|
|
3
|
+
|
|
4
|
+
#include <ReactCommon/TurboModuleManagerDelegate.h>
|
|
5
|
+
#include <fbjni/fbjni.h>
|
|
6
|
+
|
|
7
|
+
namespace facebook {
|
|
8
|
+
namespace react {
|
|
9
|
+
|
|
10
|
+
class MainApplicationTurboModuleManagerDelegate
|
|
11
|
+
: public jni::HybridClass<
|
|
12
|
+
MainApplicationTurboModuleManagerDelegate,
|
|
13
|
+
TurboModuleManagerDelegate> {
|
|
14
|
+
public:
|
|
15
|
+
// Adapt it to the package you used for your Java class.
|
|
16
|
+
static constexpr auto kJavaDescriptor =
|
|
17
|
+
"Lcom/exampleforwebview/newarchitecture/modules/MainApplicationTurboModuleManagerDelegate;";
|
|
18
|
+
|
|
19
|
+
static jni::local_ref<jhybriddata> initHybrid(jni::alias_ref<jhybridobject>);
|
|
20
|
+
|
|
21
|
+
static void registerNatives();
|
|
22
|
+
|
|
23
|
+
std::shared_ptr<TurboModule> getTurboModule(
|
|
24
|
+
const std::string &name,
|
|
25
|
+
const std::shared_ptr<CallInvoker> &jsInvoker) override;
|
|
26
|
+
std::shared_ptr<TurboModule> getTurboModule(
|
|
27
|
+
const std::string &name,
|
|
28
|
+
const JavaTurboModule::InitParams ¶ms) override;
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Test-only method. Allows user to verify whether a TurboModule can be
|
|
32
|
+
* created by instances of this class.
|
|
33
|
+
*/
|
|
34
|
+
bool canCreateTurboModule(const std::string &name);
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
} // namespace react
|
|
38
|
+
} // namespace facebook
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
#include "MainComponentsRegistry.h"
|
|
2
|
+
|
|
3
|
+
#include <CoreComponentsRegistry.h>
|
|
4
|
+
#include <fbjni/fbjni.h>
|
|
5
|
+
#include <react/renderer/componentregistry/ComponentDescriptorProviderRegistry.h>
|
|
6
|
+
#include <react/renderer/components/rncore/ComponentDescriptors.h>
|
|
7
|
+
#include <rncli.h>
|
|
8
|
+
|
|
9
|
+
namespace facebook {
|
|
10
|
+
namespace react {
|
|
11
|
+
|
|
12
|
+
MainComponentsRegistry::MainComponentsRegistry(ComponentFactory *delegate) {}
|
|
13
|
+
|
|
14
|
+
std::shared_ptr<ComponentDescriptorProviderRegistry const>
|
|
15
|
+
MainComponentsRegistry::sharedProviderRegistry() {
|
|
16
|
+
auto providerRegistry = CoreComponentsRegistry::sharedProviderRegistry();
|
|
17
|
+
|
|
18
|
+
// Autolinked providers registered by RN CLI
|
|
19
|
+
rncli_registerProviders(providerRegistry);
|
|
20
|
+
|
|
21
|
+
// Custom Fabric Components go here. You can register custom
|
|
22
|
+
// components coming from your App or from 3rd party libraries here.
|
|
23
|
+
//
|
|
24
|
+
// providerRegistry->add(concreteComponentDescriptorProvider<
|
|
25
|
+
// AocViewerComponentDescriptor>());
|
|
26
|
+
return providerRegistry;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
jni::local_ref<MainComponentsRegistry::jhybriddata>
|
|
30
|
+
MainComponentsRegistry::initHybrid(
|
|
31
|
+
jni::alias_ref<jclass>,
|
|
32
|
+
ComponentFactory *delegate) {
|
|
33
|
+
auto instance = makeCxxInstance(delegate);
|
|
34
|
+
|
|
35
|
+
auto buildRegistryFunction =
|
|
36
|
+
[](EventDispatcher::Weak const &eventDispatcher,
|
|
37
|
+
ContextContainer::Shared const &contextContainer)
|
|
38
|
+
-> ComponentDescriptorRegistry::Shared {
|
|
39
|
+
auto registry = MainComponentsRegistry::sharedProviderRegistry()
|
|
40
|
+
->createComponentDescriptorRegistry(
|
|
41
|
+
{eventDispatcher, contextContainer});
|
|
42
|
+
|
|
43
|
+
auto mutableRegistry =
|
|
44
|
+
std::const_pointer_cast<ComponentDescriptorRegistry>(registry);
|
|
45
|
+
|
|
46
|
+
mutableRegistry->setFallbackComponentDescriptor(
|
|
47
|
+
std::make_shared<UnimplementedNativeViewComponentDescriptor>(
|
|
48
|
+
ComponentDescriptorParameters{
|
|
49
|
+
eventDispatcher, contextContainer, nullptr}));
|
|
50
|
+
|
|
51
|
+
return registry;
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
delegate->buildRegistryFunction = buildRegistryFunction;
|
|
55
|
+
return instance;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
void MainComponentsRegistry::registerNatives() {
|
|
59
|
+
registerHybrid({
|
|
60
|
+
makeNativeMethod("initHybrid", MainComponentsRegistry::initHybrid),
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
} // namespace react
|
|
65
|
+
} // namespace facebook
|