├── .editorconfig ├── .github └── workflows │ └── nodejs.yml ├── .gitignore ├── .idea ├── codeStyles │ └── Project.xml └── vcs.xml ├── .npmignore ├── API详细说明.md ├── CHANGELOG.md ├── LICENSE ├── README.md ├── android ├── .idea │ ├── .gitignore │ ├── codeStyles │ │ └── Project.xml │ ├── gradle.xml │ ├── modules.xml │ └── vcs.xml ├── build.gradle ├── libs │ ├── arm64-v8a │ │ └── libCtaApiLib.so │ ├── armeabi-v7a │ │ └── libCtaApiLib.so │ ├── armeabi │ │ └── libCtaApiLib.so │ ├── jverification-android-release-2.7.2.jar │ ├── x86 │ │ └── libCtaApiLib.so │ └── x86_64 │ │ └── libCtaApiLib.so └── src │ └── main │ ├── AndroidManifest.xml │ ├── java │ └── cn │ │ └── jiguang │ │ └── plugins │ │ └── verification │ │ ├── JVerificationModule.java │ │ ├── JVerificationPackage.java │ │ └── common │ │ ├── JConstans.java │ │ └── JLogger.java │ └── res │ ├── anim │ └── umcsdk_anim_loading.xml │ ├── drawable-xxhdpi │ ├── umcsdk_check_image.png │ ├── umcsdk_exception_bg.9.png │ ├── umcsdk_exception_icon.png │ ├── umcsdk_load_complete_w.png │ ├── umcsdk_load_dot_white.png │ ├── umcsdk_login_btn_normal.png │ ├── umcsdk_login_btn_press.png │ ├── umcsdk_login_btn_unable.png │ ├── umcsdk_mobile_logo.png │ ├── umcsdk_return_bg.png │ ├── umcsdk_shape_input.png │ ├── umcsdk_sms_normal.png │ ├── umcsdk_sms_press.png │ ├── umcsdk_sms_unable.png │ ├── umcsdk_toast_bg.png │ └── umcsdk_uncheck_image.png │ ├── drawable │ ├── dialog_bg.xml │ ├── umcsdk_get_smscode_btn_bg.xml │ └── umcsdk_login_btn_bg.xml │ └── values │ └── styles.xml ├── example ├── .buckconfig ├── .eslintrc.js ├── .flowconfig ├── .gitattributes ├── .gitignore ├── .prettierrc.js ├── .watchmanconfig ├── App.js ├── CustomView1.js ├── CustomView2.js ├── CustomView3.js ├── __tests__ │ └── App-test.js ├── android │ ├── app │ │ ├── build.gradle │ │ ├── debug.keystore │ │ └── src │ │ │ └── main │ │ │ ├── AndroidManifest.xml │ │ │ ├── java │ │ │ └── com │ │ │ │ └── example │ │ │ │ ├── MainActivity.java │ │ │ │ └── MainApplication.java │ │ │ └── res │ │ │ ├── drawable │ │ │ ├── checkbox_selected.png │ │ │ ├── checkbox_unselected.png │ │ │ ├── close.png │ │ │ ├── login_btn_normal.png │ │ │ ├── login_btn_press.png │ │ │ ├── login_btn_selector.xml │ │ │ ├── login_btn_unable.png │ │ │ └── umcsdk_mobile_logo.png │ │ │ ├── mipmap-hdpi │ │ │ ├── ic_launcher.png │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-mdpi │ │ │ ├── ic_launcher.png │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-xhdpi │ │ │ ├── ic_launcher.png │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-xxhdpi │ │ │ ├── ic_launcher.png │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-xxxhdpi │ │ │ ├── ic_launcher.png │ │ │ └── ic_launcher_round.png │ │ │ ├── values │ │ │ ├── strings.xml │ │ │ └── styles.xml │ │ │ └── xml │ │ │ └── network_security_config.xml │ ├── build.gradle │ ├── gradle.properties │ ├── gradle │ │ └── wrapper │ │ │ ├── gradle-wrapper.jar │ │ │ └── gradle-wrapper.properties │ ├── gradlew │ ├── gradlew.bat │ └── settings.gradle ├── app.json ├── babel.config.js ├── img │ └── my_icon.jpg ├── index.js ├── ios │ ├── JVerificationResource.bundle │ │ ├── bg.png │ │ ├── checkBox_selected@2x.png │ │ ├── checkBox_selected@3x.png │ │ ├── checkBox_unSelected@2x.png │ │ ├── checkBox_unSelected@3x.png │ │ ├── close@2x.png │ │ ├── close@3x.png │ │ ├── loginBtn_Dis@2x.png │ │ ├── loginBtn_Dis@3x.png │ │ ├── loginBtn_Hig@2x.png │ │ ├── loginBtn_Hig@3x.png │ │ ├── loginBtn_Nor@2x.png │ │ ├── loginBtn_Nor@3x.png │ │ ├── umcsdk_mobile_logo.png │ │ └── windowClose.png │ ├── Podfile │ ├── Podfile.lock │ ├── example.xcodeproj │ │ ├── project.pbxproj │ │ └── xcshareddata │ │ │ └── xcschemes │ │ │ ├── example-tvOS.xcscheme │ │ │ └── example.xcscheme │ ├── example.xcworkspace │ │ ├── contents.xcworkspacedata │ │ └── xcshareddata │ │ │ └── IDEWorkspaceChecks.plist │ └── example │ │ ├── AppDelegate.h │ │ ├── AppDelegate.m │ │ ├── Base.lproj │ │ └── LaunchScreen.xib │ │ ├── Images.xcassets │ │ ├── AppIcon.appiconset │ │ │ └── Contents.json │ │ └── Contents.json │ │ ├── Info.plist │ │ └── main.m ├── metro.config.js └── package.json ├── index.js ├── ios ├── RCTJVerificationModule.xcodeproj │ ├── project.pbxproj │ └── project.xcworkspace │ │ ├── contents.xcworkspacedata │ │ └── xcshareddata │ │ ├── IDEWorkspaceChecks.plist │ │ └── WorkspaceSettings.xcsettings └── RCTJVerificationModule │ ├── EAccountApiSDK.framework │ ├── EAccountApiSDK │ ├── Headers │ │ ├── EAccountCTEConfig.h │ │ ├── EAccountPreLoginConfigModel.h │ │ └── EAccountSDK.h │ └── Info.plist │ ├── ESOneKeyLogin.framework │ ├── ESOneKeyLogin │ ├── Headers │ │ ├── ESLoginService.h │ │ └── ESOneKeyLogin.h │ ├── Info.plist │ ├── Modules │ │ └── module.modulemap │ └── _CodeSignature │ │ ├── CodeDirectory │ │ ├── CodeRequirements │ │ ├── CodeRequirements-1 │ │ ├── CodeResources │ │ └── CodeSignature │ ├── JVERIFICATIONService.h │ ├── OAuth.framework │ ├── Headers │ │ ├── ZOAuthManager.h │ │ ├── ZTOAuthManager.h │ │ └── ZUOAuthManager.h │ ├── Info.plist │ ├── OAuth │ └── _CodeSignature │ │ ├── CodeDirectory │ │ ├── CodeRequirements │ │ ├── CodeRequirements-1 │ │ ├── CodeResources │ │ └── CodeSignature │ ├── RCTJVerificationModule.h │ ├── RCTJVerificationModule.m │ ├── TYRZUISDK.framework │ ├── Headers │ │ ├── TYRZSDK.h │ │ ├── UACustomModel.h │ │ ├── UAEnums.h │ │ ├── UASDKErrorCode.h │ │ └── UASDKLogin.h │ ├── Info.plist │ └── TYRZUISDK │ ├── account_login_sdk_noui_core.framework │ ├── Headers │ │ ├── UniAuthHelper.h │ │ └── account_login_sdk_noui_core.h │ ├── Info.plist │ ├── Modules │ │ └── module.modulemap │ └── account_login_sdk_noui_core │ └── libjverification-ios-2.7.1.a ├── jverification-react-native.podspec ├── package.json └── 认证SDK授权页面元素配置API说明.md /.editorconfig: -------------------------------------------------------------------------------- 1 | node_modules -------------------------------------------------------------------------------- /.github/workflows/nodejs.yml: -------------------------------------------------------------------------------- 1 | # This workflow will run tests using node and then publish a package to GitHub Packages when a release is created 2 | # For more information see: https://help.github.com/actions/language-and-framework-guides/publishing-nodejs-packages 3 | name: npm-publish 4 | on: 5 | push: 6 | branches: 7 | - master # Change this to your default branch 8 | jobs: 9 | npm-publish: 10 | name: npm-publish 11 | runs-on: ubuntu-latest 12 | steps: 13 | - name: Checkout repository 14 | uses: actions/checkout@master 15 | - name: Set up Node.js 16 | uses: actions/setup-node@master 17 | with: 18 | node-version: 10.0.0 19 | registry-url: https://registry.npmjs.org/ 20 | - run: npm publish 21 | env: # More info about the environment variables in the README 22 | NODE_AUTH_TOKEN: ${{secrets.NPM_AUTH_TOKEN}} # You need to set this in your repo settings 23 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | ### Android template 2 | # Built application files 3 | *.apk 4 | *.ap_ 5 | 6 | # Files for the ART/Dalvik VM 7 | *.dex 8 | 9 | # Java class files 10 | *.class 11 | 12 | # Generated files 13 | bin/ 14 | gen/ 15 | out/ 16 | 17 | # Gradle files 18 | .gradle/ 19 | build/ 20 | 21 | # Local configuration file (sdk path, etc) 22 | local.properties 23 | 24 | # Proguard folder generated by Eclipse 25 | proguard/ 26 | 27 | # Log Files 28 | *.log 29 | 30 | # Android Studio Navigation editor temp files 31 | .navigation/ 32 | 33 | # Android Studio captures folder 34 | captures/ 35 | 36 | # IntelliJ 37 | *.iml 38 | .idea/workspace.xml 39 | .idea/tasks.xml 40 | .idea/gradle.xml 41 | .idea/dictionaries 42 | .idea/libraries 43 | 44 | # Keystore files 45 | # Uncomment the following line if you do not want to check your keystore files in. 46 | #*.jks 47 | 48 | # External native build folder generated in Android Studio 2.2 and later 49 | .externalNativeBuild 50 | 51 | # Google Services (e.g. APIs or Firebase) 52 | google-services.json 53 | 54 | # Freeline 55 | freeline.py 56 | freeline/ 57 | freeline_project_description.json 58 | 59 | ### JetBrains template 60 | # Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and Webstorm 61 | # Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839 62 | 63 | # User-specific stuff: 64 | .idea/**/workspace.xml 65 | .idea/**/tasks.xml 66 | 67 | # Sensitive or high-churn files: 68 | .idea/**/dataSources/ 69 | .idea/**/dataSources.ids 70 | .idea/**/dataSources.xml 71 | .idea/**/dataSources.local.xml 72 | .idea/**/sqlDataSources.xml 73 | .idea/**/dynamic.xml 74 | .idea/**/uiDesigner.xml 75 | 76 | # Gradle: 77 | .idea/**/gradle.xml 78 | .idea/**/libraries 79 | 80 | # CMake 81 | cmake-build-debug/ 82 | cmake-build-release/ 83 | 84 | # Mongo Explorer plugin: 85 | .idea/**/mongoSettings.xml 86 | 87 | ## File-based project format: 88 | *.iws 89 | 90 | ## Plugin-specific files: 91 | 92 | # IntelliJ 93 | 94 | # mpeltonen/sbt-idea plugin 95 | .idea_modules/ 96 | 97 | # JIRA plugin 98 | atlassian-ide-plugin.xml 99 | 100 | # Cursive Clojure plugin 101 | .idea/replstate.xml 102 | 103 | # Crashlytics plugin (for Android Studio and IntelliJ) 104 | com_crashlytics_export_strings.xml 105 | crashlytics.properties 106 | crashlytics-build.properties 107 | fabric.properties 108 | 109 | ### VisualStudioCode template 110 | .vscode/* 111 | !.vscode/settings.json 112 | !.vscode/tasks.json 113 | !.vscode/launch.json 114 | !.vscode/extensions.json 115 | 116 | ### Xcode template 117 | # Xcode 118 | # 119 | # gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore 120 | 121 | ## User settings 122 | xcuserdata/ 123 | 124 | ## compatibility with Xcode 8 and earlier (ignoring not required starting Xcode 9) 125 | *.xcscmblueprint 126 | *.xccheckout 127 | 128 | ## compatibility with Xcode 3 and earlier (ignoring not required starting Xcode 4) 129 | DerivedData/ 130 | *.moved-aside 131 | *.pbxuser 132 | !default.pbxuser 133 | *.mode1v3 134 | !default.mode1v3 135 | *.mode2v3 136 | !default.mode2v3 137 | *.perspectivev3 138 | !default.perspectivev3 139 | 140 | ### Node template 141 | # Logs 142 | logs 143 | npm-debug.log* 144 | yarn-debug.log* 145 | yarn-error.log* 146 | 147 | # Runtime data 148 | pids 149 | *.pid 150 | *.seed 151 | *.pid.lock 152 | 153 | # Directory for instrumented libs generated by jscoverage/JSCover 154 | lib-cov 155 | 156 | # Coverage directory used by tools like istanbul 157 | coverage 158 | 159 | # nyc test coverage 160 | .nyc_output 161 | 162 | # Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) 163 | .grunt 164 | 165 | # Bower dependency directory (https://bower.io/) 166 | bower_components 167 | 168 | # node-waf configuration 169 | .lock-wscript 170 | 171 | # Compiled binary addons (https://nodejs.org/api/addons.html) 172 | build/Release 173 | 174 | # Dependency directories 175 | node_modules/ 176 | jspm_packages/ 177 | 178 | # Typescript v1 declaration files 179 | typings/ 180 | 181 | # Optional npm cache directory 182 | .npm 183 | 184 | # Optional eslint cache 185 | .eslintcache 186 | 187 | # Optional REPL history 188 | .node_repl_history 189 | 190 | # Output of 'npm pack' 191 | *.tgz 192 | 193 | # Yarn Integrity file 194 | .yarn-integrity 195 | 196 | # dotenv environment variables file 197 | .env 198 | 199 | # next.js build output 200 | .next 201 | 202 | ### Customize 203 | package-lock.json 204 | yarn.lock 205 | *.qshell 206 | *.DS_Store 207 | 208 | *.gitattributes 209 | .idea 210 | index.android.bundle 211 | -------------------------------------------------------------------------------- /.idea/codeStyles/Project.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 7 | 8 | 9 |
10 | 11 | 12 | 13 | xmlns:android 14 | 15 | ^$ 16 | 17 | 18 | 19 |
20 |
21 | 22 | 23 | 24 | xmlns:.* 25 | 26 | ^$ 27 | 28 | 29 | BY_NAME 30 | 31 |
32 |
33 | 34 | 35 | 36 | .*:id 37 | 38 | http://schemas.android.com/apk/res/android 39 | 40 | 41 | 42 |
43 |
44 | 45 | 46 | 47 | .*:name 48 | 49 | http://schemas.android.com/apk/res/android 50 | 51 | 52 | 53 |
54 |
55 | 56 | 57 | 58 | name 59 | 60 | ^$ 61 | 62 | 63 | 64 |
65 |
66 | 67 | 68 | 69 | style 70 | 71 | ^$ 72 | 73 | 74 | 75 |
76 |
77 | 78 | 79 | 80 | .* 81 | 82 | ^$ 83 | 84 | 85 | BY_NAME 86 | 87 |
88 |
89 | 90 | 91 | 92 | .* 93 | 94 | http://schemas.android.com/apk/res/android 95 | 96 | 97 | ANDROID_ATTRIBUTE_ORDER 98 | 99 |
100 |
101 | 102 | 103 | 104 | .* 105 | 106 | .* 107 | 108 | 109 | BY_NAME 110 | 111 |
112 |
113 |
114 |
115 |
116 |
-------------------------------------------------------------------------------- /.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /.npmignore: -------------------------------------------------------------------------------- 1 | example/ 2 | .github/ -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | ### v 2.4.8 2 | - android 更新到 2.7.2,iOS sdk更新到2.7.1 。 3 | 4 | ### v 2.4.7 5 | - 修复android偶现的崩溃问题。 6 | 7 | ### v 2.4.6 8 | - 1、修复android弹窗模式透明度问题。 9 | - 2、修复其他bug。 10 | 11 | ### v 2.4.5 12 | - android和iOS sdk更新到2.6.7 ,支持cheockBox未选中回调。补充相关认证授权页API说明文档。 13 | 14 | ### v 2.4.4 15 | - android增加弹窗自定义关闭按钮 16 | 17 | ### v 2.4.3 18 | - iOS、android增加弹窗登录 19 | 20 | ### v 2.4.2 21 | - 修复bug,优化体验 22 | 23 | ### v 2.4.1 24 | - 修复了安卓设置隐私文字大小无效 25 | 26 | ### v 2.4.0 27 | - 更新了原生sdk版本 28 | - 增加获取验证码,设置前后两次获取验证码时间间隔的功能 29 | 30 | ### v 2.3.0 31 | 1.由于RN-JCore1.6.0存在编译问题,从RN-JCore1.7.0开始,还是需要在AndroidManifest.xml中添加配置代码,具体参考 配置-2.1 Android 32 | 33 | 2.修复添加自定义布局问题 34 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2019 极光开发者 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # JVerification-React-Native 2 | 3 | ## 1. 安装 4 | 5 | ``` 6 | npm install jverification-react-native --save 7 | ``` 8 | 9 | * 注意:如果项目里没有jcore-react-native,需要安装 10 | 11 | ``` 12 | npm install jcore-react-native --save 13 | ``` 14 | 15 | ## 2. 配置 16 | 17 | ### 2.1 Android 18 | 19 | * build.gradle 20 | 21 | ``` 22 | android { 23 | defaultConfig { 24 | applicationId "yourApplicationId" //在此替换你的应用包名 25 | ... 26 | manifestPlaceholders = [ 27 | JPUSH_APPKEY: "yourAppKey", //在此替换你的APPKey 28 | JPUSH_CHANNEL: "yourChannel" //在此替换你的channel 29 | ] 30 | } 31 | } 32 | ``` 33 | 34 | ``` 35 | dependencies { 36 | ... 37 | implementation project(':jverification-react-native') // 添加 jverification 依赖 38 | implementation project(':jcore-react-native') // 添加 jcore 依赖 39 | } 40 | ``` 41 | 42 | * setting.gradle 43 | 44 | ``` 45 | include ':jverification-react-native' 46 | project(':jverification-react-native').projectDir = new File(rootProject.projectDir, '../node_modules/jverification-react-native/android') 47 | include ':jcore-react-native' 48 | project(':jcore-react-native').projectDir = new File(rootProject.projectDir, '../node_modules/jcore-react-native/android') 49 | ``` 50 | 51 | ### 2.2 iOS 52 | 53 | ### 2.2.1 pod 54 | 55 | ``` 56 | pod install 57 | ``` 58 | 59 | * 注意:如果项目里使用pod安装过,请先执行命令 60 | 61 | ``` 62 | pod deintegrate 63 | ``` 64 | 65 | ### 2.2.2 配置AppKey 66 | 67 | * App.js 68 | ``` 69 | const initParams = { 70 | 'time': 5000, 71 | 'appKey': 'yourAppKey', //仅iOS 72 | 'channel': 'channel', //仅iOS 73 | 'advertisingId': 'advertisingId', //仅iOS 74 | 'isProduction': false, //仅iOS 75 | }; 76 | ``` 77 | 78 | ## 3. 引用 79 | 80 | 参考:[App.js](https://github.com/jpush/jverification-react-native/tree/master/example/App.js) 81 | 82 | ## 4. API 83 | + API详细说明:[API详细说明.md](https://github.com/jpush/jverification-react-native/blob/master/API%E8%AF%A6%E7%BB%86%E8%AF%B4%E6%98%8E.md) 84 | 85 | + 授权页面元素配置说明:[认证SDK授权页面元素配置API说明.md](https://github.com/jpush/jverification-react-native/blob/master/%E8%AE%A4%E8%AF%81SDK%E6%8E%88%E6%9D%83%E9%A1%B5%E9%9D%A2%E5%85%83%E7%B4%A0%E9%85%8D%E7%BD%AEAPI%E8%AF%B4%E6%98%8E.md) 86 | 87 | + 示例详见:[index.js](https://github.com/jpush/jverification-react-native/tree/master/index.js) 88 | 89 | ## 5. 其他 90 | 91 | * 集成前务必将example工程跑通 92 | * JVerification2.2.0属于重构版本,如有紧急需求请前往[极光社区](https://community.jiguang.cn/c/question) 93 | * 上报问题还麻烦先调用JVerification.setLoggerEnable( true),拿到debug日志 94 | 95 | 96 | -------------------------------------------------------------------------------- /android/.idea/.gitignore: -------------------------------------------------------------------------------- 1 | 2 | # Default ignored files 3 | /workspace.xml -------------------------------------------------------------------------------- /android/.idea/codeStyles/Project.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 7 | 8 | 9 |
10 | 11 | 12 | 13 | xmlns:android 14 | 15 | ^$ 16 | 17 | 18 | 19 |
20 |
21 | 22 | 23 | 24 | xmlns:.* 25 | 26 | ^$ 27 | 28 | 29 | BY_NAME 30 | 31 |
32 |
33 | 34 | 35 | 36 | .*:id 37 | 38 | http://schemas.android.com/apk/res/android 39 | 40 | 41 | 42 |
43 |
44 | 45 | 46 | 47 | .*:name 48 | 49 | http://schemas.android.com/apk/res/android 50 | 51 | 52 | 53 |
54 |
55 | 56 | 57 | 58 | name 59 | 60 | ^$ 61 | 62 | 63 | 64 |
65 |
66 | 67 | 68 | 69 | style 70 | 71 | ^$ 72 | 73 | 74 | 75 |
76 |
77 | 78 | 79 | 80 | .* 81 | 82 | ^$ 83 | 84 | 85 | BY_NAME 86 | 87 |
88 |
89 | 90 | 91 | 92 | .* 93 | 94 | http://schemas.android.com/apk/res/android 95 | 96 | 97 | ANDROID_ATTRIBUTE_ORDER 98 | 99 |
100 |
101 | 102 | 103 | 104 | .* 105 | 106 | .* 107 | 108 | 109 | BY_NAME 110 | 111 |
112 |
113 |
114 |
115 |
116 |
-------------------------------------------------------------------------------- /android/.idea/gradle.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 13 | 14 | -------------------------------------------------------------------------------- /android/.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /android/.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /android/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.library' 2 | 3 | def safeExtGet(prop, fallback) { 4 | rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback 5 | } 6 | 7 | android { 8 | compileSdkVersion safeExtGet('compileSdkVersion', 29) 9 | buildToolsVersion safeExtGet('buildToolsVersion', '29.0.0') 10 | defaultConfig { 11 | minSdkVersion safeExtGet('minSdkVersion', 16) 12 | targetSdkVersion safeExtGet('targetSdkVersion', 29) 13 | } 14 | sourceSets.main { 15 | jniLibs.srcDirs = ['libs'] 16 | } 17 | } 18 | 19 | dependencies { 20 | implementation fileTree(include: ['*.jar'], dir: 'libs') 21 | implementation 'com.facebook.react:react-native:+' 22 | } 23 | -------------------------------------------------------------------------------- /android/libs/arm64-v8a/libCtaApiLib.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jpush/jverification-react-native/88eed9b897a0c12e52ce151c4a266216cd6109be/android/libs/arm64-v8a/libCtaApiLib.so -------------------------------------------------------------------------------- /android/libs/armeabi-v7a/libCtaApiLib.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jpush/jverification-react-native/88eed9b897a0c12e52ce151c4a266216cd6109be/android/libs/armeabi-v7a/libCtaApiLib.so -------------------------------------------------------------------------------- /android/libs/armeabi/libCtaApiLib.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jpush/jverification-react-native/88eed9b897a0c12e52ce151c4a266216cd6109be/android/libs/armeabi/libCtaApiLib.so -------------------------------------------------------------------------------- /android/libs/jverification-android-release-2.7.2.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jpush/jverification-react-native/88eed9b897a0c12e52ce151c4a266216cd6109be/android/libs/jverification-android-release-2.7.2.jar -------------------------------------------------------------------------------- /android/libs/x86/libCtaApiLib.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jpush/jverification-react-native/88eed9b897a0c12e52ce151c4a266216cd6109be/android/libs/x86/libCtaApiLib.so -------------------------------------------------------------------------------- /android/libs/x86_64/libCtaApiLib.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jpush/jverification-react-native/88eed9b897a0c12e52ce151c4a266216cd6109be/android/libs/x86_64/libCtaApiLib.so -------------------------------------------------------------------------------- /android/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 28 | 29 | 30 | 31 | 36 | 37 | 38 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /android/src/main/java/cn/jiguang/plugins/verification/JVerificationPackage.java: -------------------------------------------------------------------------------- 1 | 2 | package cn.jiguang.plugins.verification; 3 | 4 | import android.graphics.Color; 5 | 6 | import com.facebook.react.ReactPackage; 7 | import com.facebook.react.bridge.NativeModule; 8 | import com.facebook.react.bridge.ReactApplicationContext; 9 | import com.facebook.react.uimanager.ViewManager; 10 | 11 | import java.util.Arrays; 12 | import java.util.Collections; 13 | import java.util.List; 14 | 15 | public class JVerificationPackage implements ReactPackage { 16 | 17 | @Override 18 | public List createNativeModules(ReactApplicationContext reactContext) { 19 | return Arrays.asList(new JVerificationModule(reactContext)); 20 | } 21 | 22 | @Override 23 | public List createViewManagers(ReactApplicationContext reactContext) { 24 | return Collections.emptyList(); 25 | } 26 | 27 | } -------------------------------------------------------------------------------- /android/src/main/java/cn/jiguang/plugins/verification/common/JConstans.java: -------------------------------------------------------------------------------- 1 | package cn.jiguang.plugins.verification.common; 2 | 3 | public class JConstans { 4 | 5 | public static final String CODE = "code"; 6 | public static final String TIME = "time"; 7 | public static final String ENABLE = "enable"; 8 | public static final String CONTENT = "content"; 9 | public static final String OPERATOR = "operator"; 10 | 11 | public static final String LOGIN_EVENT = "LoginEvent"; 12 | 13 | public static final String PARAMS_NULL = "params cant be null"; 14 | 15 | //*******************************自定义登录页面******************************* 16 | 17 | public static final String BACK_GROUND_IMAGE = "backgroundImage"; //背景图 18 | 19 | public static final String STATUS_BAR_HIDDEN = "statusBarHidden"; //状态栏是否隐藏 20 | public static final String STATUS_BAR_MODE = "statusBarMode"; //状态栏模式。light和dark 21 | public static final String STATUS_BAR_MODE_LIGHT = "light"; //状态栏暗色模式。 22 | public static final String STATUS_BAR_MODE_DARK = "dark"; //状态栏暗色模式。仅在android 6.0以上设备生效。 23 | 24 | public static final String NAV_HIDDEN = "navHidden"; //导航栏是否隐藏 25 | public static final String NAV_COLOR = "navColor"; //导航栏颜色 26 | 27 | public static final String NAV_TITLE = "navTitle"; //导航栏标题 28 | public static final String NAV_TITLE_SIZE = "navTitleSize"; //导航栏标题文字字体大小(单位:sp) 29 | public static final String NAV_TITLE_COLOR = "navTitleColor"; //导航栏标题文字颜色 30 | 31 | public static final String NAV_RETURN_BTN_HIDDEN = "navReturnHidden"; //导航栏返回按钮是否隐藏 32 | public static final String NAV_RETURN_BTN_IMAGE = "navReturnImage"; //导航栏左侧返回按钮图标 33 | public static final String NAV_RETURN_BTN_X = "navReturnX"; //导航栏返回按钮距屏幕左侧偏移 34 | public static final String NAV_RETURN_BTN_Y = "navReturnY"; //导航栏返回按钮距上端偏移 35 | public static final String NAV_RETURN_BTN_W = "navReturnW"; //导航栏返回按钮宽度 36 | public static final String NAV_RETURN_BTN_H = "navReturnH"; //导航栏返回按钮高度 37 | 38 | public static final String LOGO_HIDDEN = "logoHidden"; //logo是否隐藏 39 | public static final String LOGO_IMAGE = "logoImage"; //logo(android默认为应用图标;ios默认无) 40 | public static final String LOGO_X = "logoX"; //logo相对于屏幕左边x轴偏移 41 | public static final String LOGO_Y = "logoY"; //logo相对于标题栏下边缘y偏移 42 | public static final String LOGO_W = "logoW"; //logo宽 43 | public static final String LOGO_H = "logoH"; //logo高 44 | 45 | public static final String NUMBER_SIZE = "numberSize"; //手机号码字体大小(单位:sp) 46 | public static final String NUMBER_COLOR = "numberColor"; //手机号码字体颜色 47 | public static final String NUMBER_X = "numberX"; //号码栏相对于屏幕左边x轴偏移 48 | public static final String NUMBER_Y = "numberY"; //号码栏相对于标题栏下边缘y偏移 49 | public static final String NUMBER_W = "numberW"; //号码栏宽度 50 | public static final String NUMBER_H = "numberH"; //号码栏高度 51 | 52 | public static final String SLOGAN_HIDDEN = "sloganHidden"; //slogan是否隐藏 53 | public static final String SLOGAN_TEXT_SIZE = "sloganTextSize"; //slogan字体大小 54 | public static final String SLOGAN_TEXT_COLOR = "sloganTextColor"; //slogan文字颜色 55 | public static final String SLOGAN_X = "sloganX"; //slogan相对于屏幕左边x轴偏移 56 | public static final String SLOGAN_Y = "sloganY"; //slogan相对于标题栏下边缘y偏移 57 | 58 | public static final String LOGIN_BTN_TEXT = "loginBtnText"; //登录按钮文字 59 | public static final String LOGIN_BTN_TEXT_SIZE = "loginBtnTextSize"; //登录按钮字体大小 60 | public static final String LOGIN_BTN_TEXT_COLOR = "loginBtnTextColor"; //登录按钮文字颜色 61 | public static final String LOGIN_BTN_IMAGE_SELECTOR = "loginBtnImageSelector"; //登录按钮selector选择样式 (仅android) 62 | public static final String LOGIN_BTN_NORMAL_IMAGE = "loginBtnNormalImage"; //登录按钮正常图片 (仅ios,三个同时设置生效) 63 | public static final String LOGIN_BTN_DISABLED_IMAGE = "loginBtnDisabledImage"; //登录按钮失效图片 (仅ios,三个同时设置生效 64 | public static final String LOGIN_BTN_SELECTED_IMAGE = "loginBtnSelectedImage"; //登录按钮按下图片 (仅ios,三个同时设置生效) 65 | public static final String LOGIN_BTN_X = "loginBtnOffsetX"; //登录按钮相对于屏幕左边x轴偏移 66 | public static final String LOGIN_BTN_Y = "loginBtnOffsetY"; //登录按钮相对于标题栏下边缘y偏移 67 | public static final String LOGIN_BTN_W = "loginBtnWidth"; //登录按钮宽度 68 | public static final String LOGIN_BTN_H = "loginBtnHeight"; //登录按钮高度 69 | 70 | public static final String PRIVACY_ONE = "privacyOne"; //隐私条款一 71 | public static final String PRIVACY_TWO = "privacyTwo"; //隐私条款二 72 | public static final String PRIVACY_COLOR = "privacyColor"; //隐私条款颜色 73 | public static final String PRIVACY_TEXT = "privacyText"; //隐私条款名称外的文字 74 | public static final String PRIVACY_TEXT_SIZE = "privacyTextSize"; //隐私条款文字字体大小 75 | public static final String PRIVACY_TEXT_GRAVITY_MODE = "privacyTextGravityMode"; //隐私条款文字是否居中对齐(默认左对齐) 76 | public static final String PRIVACY_TEXT_GRAVITY_LEFT = "left"; //隐私条款文字是否居中对齐(默认左对齐) 77 | public static final String PRIVACY_TEXT_GRAVITY_CENTER = "center"; //隐私条款文字是否居中对齐(默认左对齐) 78 | public static final String PRIVACY_X = "privacyOffsetX"; //隐私条款相对于屏幕左边x轴偏移 79 | public static final String PRIVACY_Y = "privacyOffsetY"; //隐私条款相对于授权页面底部下边缘y偏移 80 | public static final String PRIVACY_W = "privacyW"; //隐私条款名称外的文字栏宽度(单位:dp) 81 | public static final String PRIVACY_H = "privacyH"; //隐私条款名称外的文字栏高度度(单位:dp) 82 | public static final String PRIVACY_BOOK_SYMBOL_ENABLE = "privacyBookSymbolEnable"; //隐私条款运营商协议名是否加书名号 83 | public static final String EnableHintToast = "unAgreePrivacyHintToast"; //导航栏颜色 84 | 85 | public static final String PRIVACY_CHECKBOX_HIDDEN = "privacyCheckboxHidden"; //隐私条款checkbox是否隐藏 86 | public static final String PRIVACY_CHECKBOX_SIZE = "privacyCheckboxSize"; //设置隐私条款checkbox尺寸 87 | public static final String PRIVACY_CHECK_ENABLE = "privacyCheckEnable"; //隐私条款默认选中状态。默认不选中 88 | public static final String PRIVACY_CHECKBOX_IMAGE = "privacyCheckedImage"; //隐私条款复选框选中图片 89 | public static final String PRIVACY_UNCHECKED_IMAGE = "privacyUncheckedImage"; //隐私条款复选框未选中图片 90 | 91 | public static final String PRIVACY_WEB_NAV_COLOR = "privacyWebNavColor"; //协议展示web页面导航栏背景颜色 92 | public static final String PRIVACY_WEB_NAV_TITLE = "privacyWebNavTitle"; //协议展示web页面导航栏标题(仅iOS) 93 | public static final String PRIVACY_WEB_NAV_TITLE_SIZE = "privacyWebNavTitleSize"; //协议展示web页面导航栏标题文字大小 94 | public static final String PRIVACY_WEB_NAV_TITLE_COLOR = "privacyWebNavTitleColor"; //协议展示web页面导航栏标题文字颜色 95 | public static final String PRIVACY_WEB_NAV_RETURN_IMAGE = "privacyWebNavReturnImage"; //协议展示web页面导航栏返回按钮图标 96 | 97 | public static final String CUSTOM_VIEW_NAME = "customViewName"; 98 | public static final String CUSTOM_VIEW_POINT = "customViewPoint"; 99 | 100 | //*******************************验证码******************************* 101 | public static final String PHONE_NUMBER = "phoneNumber"; 102 | public static final String SING_ID = "signID"; 103 | public static final String TEMPLATE_ID = "templateID"; 104 | 105 | // 授权页动画 106 | public static final String PRIVACY_NEED_START_ANIM = "privacyNeedStartAnim"; 107 | public static final String PRIVACY_NEED_CLOSE_ANIM = "privacyNeedCloseAnim"; 108 | // 授权页弹窗模式 109 | public static final String PRIVACY_DIALOG_THEME = "privacyDialogTheme"; 110 | // 弹窗是否需要配置关闭按钮 111 | public static final String PRIVACY_NEED_CLOSE = "privacyNeedClose"; 112 | // 弹窗关闭按钮模式 113 | public static final String PRIVACY_CLOSE_THEME = "privacyCloseTheme"; 114 | 115 | } 116 | -------------------------------------------------------------------------------- /android/src/main/java/cn/jiguang/plugins/verification/common/JLogger.java: -------------------------------------------------------------------------------- 1 | package cn.jiguang.plugins.verification.common; 2 | 3 | 4 | import android.util.Log; 5 | 6 | public class JLogger { 7 | 8 | public static final String TAG = "RN-JVerification"; 9 | 10 | private static boolean isLoggerEnable = false; 11 | 12 | public static void setLoggerEnable(boolean loggerEnable) { 13 | Log.d(TAG, "setLoggerEnable:" + loggerEnable); 14 | isLoggerEnable = loggerEnable; 15 | } 16 | 17 | public static void i(String msg) { 18 | if (isLoggerEnable) { 19 | Log.i(TAG, msg); 20 | } 21 | } 22 | 23 | public static void d(String msg) { 24 | if (isLoggerEnable) { 25 | Log.d(TAG, msg); 26 | } 27 | } 28 | 29 | public static void v(String msg) { 30 | if (isLoggerEnable) { 31 | Log.v(TAG, msg); 32 | } 33 | } 34 | 35 | public static void w(String msg) { 36 | if (isLoggerEnable) { 37 | Log.w(TAG, msg); 38 | } 39 | } 40 | 41 | public static void e(String error) { 42 | if (isLoggerEnable) { 43 | Log.e(TAG, error); 44 | } 45 | } 46 | 47 | } 48 | 49 | -------------------------------------------------------------------------------- /android/src/main/res/anim/umcsdk_anim_loading.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 10 | 11 | -------------------------------------------------------------------------------- /android/src/main/res/drawable-xxhdpi/umcsdk_check_image.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jpush/jverification-react-native/88eed9b897a0c12e52ce151c4a266216cd6109be/android/src/main/res/drawable-xxhdpi/umcsdk_check_image.png -------------------------------------------------------------------------------- /android/src/main/res/drawable-xxhdpi/umcsdk_exception_bg.9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jpush/jverification-react-native/88eed9b897a0c12e52ce151c4a266216cd6109be/android/src/main/res/drawable-xxhdpi/umcsdk_exception_bg.9.png -------------------------------------------------------------------------------- /android/src/main/res/drawable-xxhdpi/umcsdk_exception_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jpush/jverification-react-native/88eed9b897a0c12e52ce151c4a266216cd6109be/android/src/main/res/drawable-xxhdpi/umcsdk_exception_icon.png -------------------------------------------------------------------------------- /android/src/main/res/drawable-xxhdpi/umcsdk_load_complete_w.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jpush/jverification-react-native/88eed9b897a0c12e52ce151c4a266216cd6109be/android/src/main/res/drawable-xxhdpi/umcsdk_load_complete_w.png -------------------------------------------------------------------------------- /android/src/main/res/drawable-xxhdpi/umcsdk_load_dot_white.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jpush/jverification-react-native/88eed9b897a0c12e52ce151c4a266216cd6109be/android/src/main/res/drawable-xxhdpi/umcsdk_load_dot_white.png -------------------------------------------------------------------------------- /android/src/main/res/drawable-xxhdpi/umcsdk_login_btn_normal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jpush/jverification-react-native/88eed9b897a0c12e52ce151c4a266216cd6109be/android/src/main/res/drawable-xxhdpi/umcsdk_login_btn_normal.png -------------------------------------------------------------------------------- /android/src/main/res/drawable-xxhdpi/umcsdk_login_btn_press.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jpush/jverification-react-native/88eed9b897a0c12e52ce151c4a266216cd6109be/android/src/main/res/drawable-xxhdpi/umcsdk_login_btn_press.png -------------------------------------------------------------------------------- /android/src/main/res/drawable-xxhdpi/umcsdk_login_btn_unable.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jpush/jverification-react-native/88eed9b897a0c12e52ce151c4a266216cd6109be/android/src/main/res/drawable-xxhdpi/umcsdk_login_btn_unable.png -------------------------------------------------------------------------------- /android/src/main/res/drawable-xxhdpi/umcsdk_mobile_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jpush/jverification-react-native/88eed9b897a0c12e52ce151c4a266216cd6109be/android/src/main/res/drawable-xxhdpi/umcsdk_mobile_logo.png -------------------------------------------------------------------------------- /android/src/main/res/drawable-xxhdpi/umcsdk_return_bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jpush/jverification-react-native/88eed9b897a0c12e52ce151c4a266216cd6109be/android/src/main/res/drawable-xxhdpi/umcsdk_return_bg.png -------------------------------------------------------------------------------- /android/src/main/res/drawable-xxhdpi/umcsdk_shape_input.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jpush/jverification-react-native/88eed9b897a0c12e52ce151c4a266216cd6109be/android/src/main/res/drawable-xxhdpi/umcsdk_shape_input.png -------------------------------------------------------------------------------- /android/src/main/res/drawable-xxhdpi/umcsdk_sms_normal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jpush/jverification-react-native/88eed9b897a0c12e52ce151c4a266216cd6109be/android/src/main/res/drawable-xxhdpi/umcsdk_sms_normal.png -------------------------------------------------------------------------------- /android/src/main/res/drawable-xxhdpi/umcsdk_sms_press.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jpush/jverification-react-native/88eed9b897a0c12e52ce151c4a266216cd6109be/android/src/main/res/drawable-xxhdpi/umcsdk_sms_press.png -------------------------------------------------------------------------------- /android/src/main/res/drawable-xxhdpi/umcsdk_sms_unable.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jpush/jverification-react-native/88eed9b897a0c12e52ce151c4a266216cd6109be/android/src/main/res/drawable-xxhdpi/umcsdk_sms_unable.png -------------------------------------------------------------------------------- /android/src/main/res/drawable-xxhdpi/umcsdk_toast_bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jpush/jverification-react-native/88eed9b897a0c12e52ce151c4a266216cd6109be/android/src/main/res/drawable-xxhdpi/umcsdk_toast_bg.png -------------------------------------------------------------------------------- /android/src/main/res/drawable-xxhdpi/umcsdk_uncheck_image.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jpush/jverification-react-native/88eed9b897a0c12e52ce151c4a266216cd6109be/android/src/main/res/drawable-xxhdpi/umcsdk_uncheck_image.png -------------------------------------------------------------------------------- /android/src/main/res/drawable/dialog_bg.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /android/src/main/res/drawable/umcsdk_get_smscode_btn_bg.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /android/src/main/res/drawable/umcsdk_login_btn_bg.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /android/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 15 | -------------------------------------------------------------------------------- /example/.buckconfig: -------------------------------------------------------------------------------- 1 | 2 | [android] 3 | target = Google Inc.:Google APIs:23 4 | 5 | [maven_repositories] 6 | central = https://repo1.maven.org/maven2 7 | -------------------------------------------------------------------------------- /example/.eslintrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | root: true, 3 | extends: '@react-native-community', 4 | }; 5 | -------------------------------------------------------------------------------- /example/.flowconfig: -------------------------------------------------------------------------------- 1 | [ignore] 2 | ; We fork some components by platform 3 | .*/*[.]android.js 4 | 5 | ; Ignore "BUCK" generated dirs 6 | /\.buckd/ 7 | 8 | ; Ignore unexpected extra "@providesModule" 9 | .*/node_modules/.*/node_modules/fbjs/.* 10 | 11 | ; Ignore duplicate module providers 12 | ; For RN Apps installed via npm, "Libraries" folder is inside 13 | ; "node_modules/react-native" but in the source repo it is in the root 14 | node_modules/react-native/Libraries/react-native/React.js 15 | 16 | ; Ignore polyfills 17 | node_modules/react-native/Libraries/polyfills/.* 18 | 19 | ; These should not be required directly 20 | ; require from fbjs/lib instead: require('fbjs/lib/warning') 21 | node_modules/warning/.* 22 | 23 | ; Flow doesn't support platforms 24 | .*/Libraries/Utilities/HMRLoadingView.js 25 | 26 | [untyped] 27 | .*/node_modules/@react-native-community/cli/.*/.* 28 | 29 | [include] 30 | 31 | [libs] 32 | node_modules/react-native/Libraries/react-native/react-native-interface.js 33 | node_modules/react-native/flow/ 34 | 35 | [options] 36 | emoji=true 37 | 38 | esproposal.optional_chaining=enable 39 | esproposal.nullish_coalescing=enable 40 | 41 | module.file_ext=.js 42 | module.file_ext=.json 43 | module.file_ext=.ios.js 44 | 45 | module.system=haste 46 | module.system.haste.use_name_reducers=true 47 | # get basename 48 | module.system.haste.name_reducers='^.*/\([a-zA-Z0-9$_.-]+\.js\(\.flow\)?\)$' -> '\1' 49 | # strip .js or .js.flow suffix 50 | module.system.haste.name_reducers='^\(.*\)\.js\(\.flow\)?$' -> '\1' 51 | # strip .ios suffix 52 | module.system.haste.name_reducers='^\(.*\)\.ios$' -> '\1' 53 | module.system.haste.name_reducers='^\(.*\)\.android$' -> '\1' 54 | module.system.haste.name_reducers='^\(.*\)\.native$' -> '\1' 55 | module.system.haste.paths.blacklist=.*/__tests__/.* 56 | module.system.haste.paths.blacklist=.*/__mocks__/.* 57 | module.system.haste.paths.whitelist=/node_modules/react-native/Libraries/.* 58 | module.system.haste.paths.whitelist=/node_modules/react-native/RNTester/.* 59 | module.system.haste.paths.whitelist=/node_modules/react-native/IntegrationTests/.* 60 | module.system.haste.paths.blacklist=/node_modules/react-native/Libraries/react-native/react-native-implementation.js 61 | module.system.haste.paths.blacklist=/node_modules/react-native/Libraries/Animated/src/polyfills/.* 62 | 63 | munge_underscores=true 64 | 65 | module.name_mapper='^[./a-zA-Z0-9$_-]+\.\(bmp\|gif\|jpg\|jpeg\|png\|psd\|svg\|webp\|m4v\|mov\|mp4\|mpeg\|mpg\|webm\|aac\|aiff\|caf\|m4a\|mp3\|wav\|html\|pdf\)$' -> 'RelativeImageStub' 66 | 67 | suppress_type=$FlowIssue 68 | suppress_type=$FlowFixMe 69 | suppress_type=$FlowFixMeProps 70 | suppress_type=$FlowFixMeState 71 | 72 | suppress_comment=\\(.\\|\n\\)*\\$FlowFixMe\\($\\|[^(]\\|(\\(\\)? *\\(site=[a-z,_]*react_native\\(_ios\\)?_\\(oss\\|fb\\)[a-z,_]*\\)?)\\) 73 | suppress_comment=\\(.\\|\n\\)*\\$FlowIssue\\((\\(\\)? *\\(site=[a-z,_]*react_native\\(_ios\\)?_\\(oss\\|fb\\)[a-z,_]*\\)?)\\)?:? #[0-9]+ 74 | suppress_comment=\\(.\\|\n\\)*\\$FlowExpectedError 75 | 76 | [lints] 77 | sketchy-null-number=warn 78 | sketchy-null-mixed=warn 79 | sketchy-number=warn 80 | untyped-type-import=warn 81 | nonstrict-import=warn 82 | deprecated-type=warn 83 | unsafe-getters-setters=warn 84 | inexact-spread=warn 85 | unnecessary-invariant=warn 86 | signature-verification-failure=warn 87 | deprecated-utility=error 88 | 89 | [strict] 90 | deprecated-type 91 | nonstrict-import 92 | sketchy-null 93 | unclear-type 94 | unsafe-getters-setters 95 | untyped-import 96 | untyped-type-import 97 | 98 | [version] 99 | ^0.98.0 100 | -------------------------------------------------------------------------------- /example/.gitattributes: -------------------------------------------------------------------------------- 1 | *.pbxproj -text 2 | -------------------------------------------------------------------------------- /example/.gitignore: -------------------------------------------------------------------------------- 1 | # OSX 2 | # 3 | .DS_Store 4 | 5 | # Xcode 6 | # 7 | build/ 8 | *.pbxuser 9 | !default.pbxuser 10 | *.mode1v3 11 | !default.mode1v3 12 | *.mode2v3 13 | !default.mode2v3 14 | *.perspectivev3 15 | !default.perspectivev3 16 | xcuserdata 17 | *.xccheckout 18 | *.moved-aside 19 | DerivedData 20 | *.hmap 21 | *.ipa 22 | *.xcuserstate 23 | project.xcworkspace 24 | 25 | # Android/IntelliJ 26 | # 27 | build/ 28 | .idea 29 | .gradle 30 | local.properties 31 | *.iml 32 | 33 | # node.js 34 | # 35 | node_modules/ 36 | npm-debug.log 37 | yarn-error.log 38 | 39 | # BUCK 40 | buck-out/ 41 | \.buckd/ 42 | *.keystore 43 | 44 | # fastlane 45 | # 46 | # It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the 47 | # screenshots whenever they are needed. 48 | # For more information about the recommended setup visit: 49 | # https://docs.fastlane.tools/best-practices/source-control/ 50 | 51 | */fastlane/report.xml 52 | */fastlane/Preview.html 53 | */fastlane/screenshots 54 | 55 | # Bundle artifact 56 | *.jsbundle 57 | 58 | # CocoaPods 59 | /ios/Pods/ 60 | -------------------------------------------------------------------------------- /example/.prettierrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | bracketSpacing: false, 3 | jsxBracketSameLine: true, 4 | singleQuote: true, 5 | trailingComma: 'all', 6 | }; 7 | -------------------------------------------------------------------------------- /example/.watchmanconfig: -------------------------------------------------------------------------------- 1 | {} -------------------------------------------------------------------------------- /example/App.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import {StyleSheet, Text, View,Alert, TouchableHighlight, Platform} from 'react-native'; 3 | import JVerification from 'jverification-react-native'; 4 | 5 | 6 | const styles = StyleSheet.create({ 7 | container: { 8 | flex: 1, 9 | justifyContent: 'center', 10 | alignItems: 'center', 11 | backgroundColor: '#F5FCFF', 12 | }, 13 | setBtnStyle: { 14 | width: 320, 15 | justifyContent: 'center', 16 | alignItems: 'center', 17 | marginTop: 10, 18 | borderWidth: 1, 19 | borderColor: '#3e83d7', 20 | borderRadius: 8, 21 | backgroundColor: '#3e83d7', 22 | padding: 10, 23 | }, 24 | textStyle: { 25 | textAlign: 'center', 26 | fontSize: 25, 27 | color: '#ffffff', 28 | }, 29 | }); 30 | 31 | class Button extends React.Component { 32 | render() { 33 | return 38 | 40 | 42 | {this.props.title} 43 | 44 | 45 | ; 46 | } 47 | } 48 | 49 | 50 | const initParams = { 51 | 'time': 5000, 52 | 'appKey': 'a0e6ace8d5b3e0247e3f58db', //仅iOS 53 | 'channel': 'channel', //仅iOS 54 | 'advertisingId': 'advertisingId', //仅iOS 55 | 'isProduction': false, //仅iOS 56 | }; 57 | 58 | //一键登录页面自定义配置,需要在调用login之前设置 59 | 60 | 61 | const customUIWithConfigiOS = { 62 | showWindow:false, 63 | navReturnHidden:false, 64 | //logo 65 | logoImage: 'umcsdk_mobile_logo', 66 | logoConstraints:[0,-200,60,60], 67 | //number 68 | numberConstraints:[0,-132,200,14], 69 | //slogn 70 | sloganConstraints:[0,-112,200,14], 71 | //登录按钮 72 | logBtnConstraints:[0,-80,220,40], 73 | loginBtnText:"一键登录", 74 | loginBtnTextColor:0x0000FF, 75 | privacyConstraints:[0,180,200,60], 76 | checkViewConstraints:[-108,180,10,10], 77 | unAgreePrivacyCallBack:true, 78 | 79 | privacyOne: ['隐私条款一', 'https://www.jiguang.cn/about'], //隐私条款一(显示名称和url,请严格按照格式) 80 | privacyTwo: ['隐私条款二', 'https://www.jiguang.cn/about'], //隐私条款二(显示名称和url,请严格按照格式) 81 | privacyColor: [-16777216, -65536], //隐私条款颜色 (显示名称和url的颜色,请严格按照格式) 82 | privacyText: ['登录即同意', '和', '、', '并使用本机号码登录'], //隐私条款名称外的文字 83 | privacyTextSize: 15, //隐私条款文字字体大小 84 | privacyTextGravityMode: 'left', //隐私条款文本对齐方式,目前仅支持 left、center 85 | privacyBookSymbolEnable: false, //隐私条款是否显示书名号,默认不显示 86 | 87 | } 88 | const customUIWithConfigAndroid = { 89 | backgroundImage: '', //背景图 90 | 91 | statusBarHidden: false, //状态栏是否隐藏 92 | statusBarMode: 'light', //状态栏模式 light,dark 93 | 94 | navHidden: false, //导航栏是否隐藏 95 | navColor: -16777216, //导航栏颜色 96 | 97 | navTitle: 'RN-JVerification', //导航栏标题 98 | navTitleSize: 16, //导航栏标题文字字体大小(单位:sp) 99 | navTitleColor: -1, //导航栏标题文字颜色 100 | 101 | navReturnHidden: false, //导航栏返回按钮是否隐藏 102 | navReturnImage: 'close', //导航栏左侧返回按钮图标 103 | //为保障显示效果,请同时设置x,y,w,h 104 | navReturnX: 5, //导航栏左侧返回按钮图标距屏幕上端偏移(仅Android) 105 | navReturnY: 5, //导航栏左侧返回按钮图标距屏幕左侧偏移(仅Android) 106 | navReturnW: 25, //导航栏左侧返回按钮图标宽度(仅Android) 107 | navReturnH: 25, //导航栏左侧返回按钮图标高度(仅Android) 108 | 109 | logoHidden: false, //logo是否隐藏 110 | logoImage: 'umcsdk_mobile_logo', //logo(android默认为应用图标;) 111 | //为保障显示效果,请同时设置x,y,w,h 112 | // logoX: 50, //logo相对于屏幕左边x轴偏移 113 | // logoY: 50, //logo相对于标题栏下边缘y偏移 114 | // logoW: 100, //logo宽 115 | // logoH: 100, //logo高 116 | 117 | numberSize: 16, //手机号码字体大小(单位:sp) 118 | numberColor: -16777216, //手机号码字体颜色 119 | //为保障显示效果,请同时设置x,y,w,h 120 | // numberX: 50, //号码栏相对于屏幕左边x轴偏移 121 | // numberY: 100, //号码栏相对于标题栏下边缘y偏移 122 | // numberW: 250, //号码栏宽度 123 | // numberH: 25, //号码栏高度 124 | 125 | sloganHidden: false, //slogan是否隐藏 126 | sloganTextSize: 16, //slogan字体大小 127 | sloganTextColor: -16777216, //slogan文字颜色 128 | 129 | //为保障显示效果,请同时设置x,y,w,h 130 | // sloganX: 50, //slogan相对于屏幕左边x轴偏移 131 | // sloganY: 150, //slogan相对于标题栏下边缘y偏移 132 | 133 | loginBtnText: '登录按钮', //登录按钮文字 134 | loginBtnTextSize: 16, //登录按钮字体大小 135 | loginBtnTextColor: -16777216, //登录按钮文字颜色 136 | 137 | loginBtnImage: 'login_btn_selector', //登录按钮selector选择样式 (仅android) 138 | loginBtnNormalImage: 'loginBtn_Nor', //登录按钮正常图片 (仅ios,三个同时设置生效) 139 | loginBtnDisabledImage: 'loginBtn_Dis', //登录按钮失效图片 (仅ios,三个同时设置生效) 140 | loginBtnSelectedImage: 'loginBtn_Hig', //登录按钮按下图片 (仅ios,三个同时设置生效) 141 | //为保障显示效果,请同时设置x,y,w,h 142 | // loginBtnX: 50, //登录按钮相对于屏幕左边x轴偏移 143 | // loginBtnY: 200, //登录按钮相对于标题栏下边缘y偏移 144 | // loginBtnW: 250, //登录按钮宽度 145 | // loginBtnH: 40, //登录按钮高度 146 | 147 | privacyOne: ['隐私条款一', 'https://www.jiguang.cn/about'], //隐私条款一(显示名称和url,请严格按照格式) 148 | privacyTwo: ['隐私条款二', 'https://www.jiguang.cn/about'], //隐私条款二(显示名称和url,请严格按照格式) 149 | privacyColor: [-16777216, -65536], //隐私条款颜色 (显示名称和url的颜色,请严格按照格式) 150 | privacyText: ['登录即同意11111', '和', '、', '并使用本机号码登录'], //隐私条款名称外的文字 151 | privacyTextSize: 15, //隐私条款文字字体大小 152 | privacyTextGravityMode: 'left', //隐私条款文本对齐方式,目前仅支持 left、center 153 | privacyBookSymbolEnable: false, //隐私条款是否显示书名号,默认不显示 154 | //为保障显示效果,请同时设置x,y,w,h 155 | // privacyX:50, //隐私条款相对于屏幕左边x轴偏移 156 | // privacyY:20, //隐私条款相对于授权页面底部下边缘y偏移 157 | // privacyW:200, //隐私条款宽度 158 | // privacyH:100, //隐私条款高度 159 | 160 | privacyCheckboxHidden: false, //checkBox是否隐藏,默认不隐藏 161 | privacyCheckEnable: false, //checkBox默认状态 默认:NO 162 | privacyCheckedImage: 'checkbox_selected', //checkBox选中时图片 163 | privacyUncheckedImage: 'checkbox_unSelected', //checkBox未选中时图片 164 | privacyCheckboxSize:10, //设置隐私条款checkbox尺寸 默认是10 165 | unAgreePrivacyHintToast: true, 166 | 167 | privacyWebNavColor: -16777216, //协议页导航栏背景颜色 168 | privacyWebNavTitle: '服务条款', //协议页导航栏标题(仅iOS) 169 | privacyWebNavTitleSize: 16, //协议页导航栏标题字体大小 170 | privacyWebNavTitleColor: -1, //协议页导航栏标题字体颜色 171 | privacyWebNavReturnImage: 'close', //协议页导航栏返回按钮图片 172 | }; 173 | 174 | const customViewParams = [ 175 | {customViewName: 'customView1', customViewPoint: [20, 200, 150, 30]}, 176 | {customViewName: 'customView2', customViewPoint: [20, 300, 150, 30]}, 177 | {customViewName: 'customView3', customViewPoint: [20, 400, 150, 30]}, 178 | ]; 179 | 180 | const codeConfig = { 181 | phoneNumber : "18925241111", //在此替换你的phoneNumber 182 | signID : "1", //在此替换你的signID 183 | templateID : "1" //在此替换你的templateID 184 | }; 185 | //安卓授权页弹窗模式 186 | const androidDialogConfig = { 187 | privacyNeedClose:true, //弹窗是否需要关闭按钮 188 | privacyCloseTheme:[10, 60, 0, 0], //弹窗关闭按钮偏移量 privacyNeedClose为true时,必须设置它的偏移量 189 | privacyDialogTheme: [300, 400, 0, 0, false], //授权页弹窗模式 190 | privacyNeedStartAnim: true, //设置拉起授权页时是否需要显示默认动画 默认展示 191 | privacyNeedCloseAnim: true, //设置关闭授权页时是否需要显示默认动画 默认展示 192 | navColor:0xff000000, 193 | loginBtnText:" 极光认证测试 ", 194 | privacyCheckEnable:false, 195 | privacyColor:[0xff00f000,0xff000000], 196 | loginBtnWidth:40, 197 | privacyOne: ['隐私条款一', 'https://www.jiguang.cn/about'], //隐私条款一(显示名称和url,请严格按照格式) 198 | privacyColor: [-16777216, -65536], //隐私条款颜色 (显示名称和url的颜色,请严格按照格式) 199 | privacyText: ['登录即同意', '和', '、', '并使用本机号码登录'], //隐私条款名称外的文字 200 | privacyTextSize: 12, 201 | } 202 | //ios授权页弹窗模式 203 | const iosDialogConfig = { 204 | navHidden:true, //导航栏是否隐藏 205 | logoImage: 'umcsdk_mobile_logo', //logo(android默认为应用图标;ios默认无) 206 | logoConstraints:[0,-100,60,60], //LOGO图片布局对象 207 | logoHidden: false, //logo是否隐藏 208 | numberConstraints:[0,-42,200,14], //号码栏布局对象 209 | sloganConstraints:[0,-20,200,14], //slogan布局对象 210 | logBtnConstraints:[0,20,220,40], 211 | loginBtnText: '登录按钮', //登录按钮文字 212 | loginBtnTextSize: 16, //登录按钮字体大小 213 | loginBtnTextColor: -16777216, //登录按钮文字颜色 214 | privacyConstraints:[0,100,200,60], //隐私条款布局对象 215 | checkViewConstraints:[-108,100,10,10], //checkBox布局对象 216 | 217 | loadingConstraints:[0,0,20,20], 218 | showWindow:true, // 是否弹窗,默认no 219 | //windowBackgroundImage:"bg", // 弹框内部背景图片 220 | windowBackgroundAlpha: 0.3, //弹窗外侧 透明度 0~1.0 221 | windowCornerRadius:10, //弹窗圆角数值 222 | windowConstraints:[0,0,300,300], //弹窗布局对象 223 | windowCloseBtnImgs:["windowClose","windowClose"],//弹窗close按钮图片 @[普通状态图片,高亮状态图片] 224 | windowCloseBtnConstraints:[-135,-135,20,20],//弹窗close按钮布局, 225 | } 226 | 227 | export default class App extends React.Component { 228 | 229 | createAlert = (title) => 230 | Alert.alert( 231 | "提示", 232 | title, 233 | [ 234 | { text: "OK", onPress: () => console.log("OK Pressed") } 235 | ] 236 | ); 237 | 238 | constructor(props) { 239 | super(props); 240 | } 241 | 242 | componentDidMount() { 243 | JVerification.setLoggerEnable(true); 244 | this.LoginListener = result => { 245 | console.log('LoginListener:' + JSON.stringify(result)); 246 | }; 247 | JVerification.addLoginEventListener(this.LoginListener); 248 | if(Platform.OS == 'ios'){ 249 | this.UnCheckboxEvent = result => { 250 | console.log('UnCheckboxEvent:未选中隐私协议框'); 251 | this.createAlert('Listener:未选中隐私协议框' ); 252 | } 253 | JVerification.addUncheckBoxEventListener(this.UnCheckboxEvent); 254 | } 255 | } 256 | 257 | render() { 258 | return ( 259 | 260 | 261 |