├── .buckconfig ├── .editorconfig ├── .eslintrc.js ├── .flowconfig ├── .gitattributes ├── .gitignore ├── .prettierrc.js ├── .vscode └── settings.json ├── .watchmanconfig ├── App.js ├── __tests__ └── App-test.js ├── amplify ├── .config │ └── project-config.json ├── backend │ ├── auth │ │ └── Authentication │ │ │ └── cli-inputs.json │ ├── backend-config.json │ ├── tags.json │ └── types │ │ └── amplify-dependent-resources-ref.d.ts ├── cli.json └── team-provider-info.json ├── android ├── app │ ├── _BUCK │ ├── build.gradle │ ├── build_defs.bzl │ ├── debug.keystore │ ├── proguard-rules.pro │ └── src │ │ ├── debug │ │ ├── AndroidManifest.xml │ │ └── java │ │ │ └── com │ │ │ └── authenetication │ │ │ └── ReactNativeFlipper.java │ │ └── main │ │ ├── AndroidManifest.xml │ │ ├── java │ │ └── com │ │ │ └── authenetication │ │ │ ├── MainActivity.java │ │ │ └── MainApplication.java │ │ └── res │ │ ├── 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 ├── build.gradle ├── gradle.properties ├── gradle │ └── wrapper │ │ ├── gradle-wrapper.jar │ │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat └── settings.gradle ├── app.json ├── assets └── images │ └── Logo_1.png ├── babel.config.js ├── index.js ├── ios ├── Authenetication.xcodeproj │ ├── project.pbxproj │ └── xcshareddata │ │ └── xcschemes │ │ └── Authenetication.xcscheme ├── Authenetication │ ├── AppDelegate.h │ ├── AppDelegate.m │ ├── Images.xcassets │ │ ├── AppIcon.appiconset │ │ │ └── Contents.json │ │ └── Contents.json │ ├── Info.plist │ ├── LaunchScreen.storyboard │ └── main.m ├── AutheneticationTests │ ├── AutheneticationTests.m │ └── Info.plist └── Podfile ├── package-lock.json ├── package.json └── src ├── components ├── CustomButton │ ├── CustomButton.js │ └── index.js ├── CustomInput │ ├── CustomInput.js │ └── index.js └── SocialSignInButtons │ ├── SocialSignInButtons.js │ └── index.js ├── navigation └── index.js └── screens ├── ConfirmEmailScreen ├── ConfirmEmailScreen.js └── index.js ├── ForgotPasswordScreen ├── ForgotPasswordScreen.js └── index.js ├── HomeScreen └── index.js ├── NewPasswordScreen ├── NewPasswordScreen.js └── index.js ├── SignInScreen ├── SignInScreen.js └── index.js └── SignUpScreen ├── SignUpScreen.js └── index.js /.buckconfig: -------------------------------------------------------------------------------- 1 | 2 | [android] 3 | target = Google Inc.:Google APIs:23 4 | 5 | [maven_repositories] 6 | central = https://repo1.maven.org/maven2 7 | -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | # Windows files 2 | [*.bat] 3 | end_of_line = crlf 4 | -------------------------------------------------------------------------------- /.eslintrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | root: true, 3 | extends: '@react-native-community', 4 | }; 5 | -------------------------------------------------------------------------------- /.flowconfig: -------------------------------------------------------------------------------- 1 | [ignore] 2 | ; We fork some components by platform 3 | .*/*[.]android.js 4 | 5 | ; Ignore "BUCK" generated dirs 6 | /\.buckd/ 7 | 8 | ; Ignore polyfills 9 | node_modules/react-native/Libraries/polyfills/.* 10 | 11 | ; Flow doesn't support platforms 12 | .*/Libraries/Utilities/LoadingView.js 13 | 14 | [untyped] 15 | .*/node_modules/@react-native-community/cli/.*/.* 16 | 17 | [include] 18 | 19 | [libs] 20 | node_modules/react-native/interface.js 21 | node_modules/react-native/flow/ 22 | 23 | [options] 24 | emoji=true 25 | 26 | exact_by_default=true 27 | 28 | module.file_ext=.js 29 | module.file_ext=.json 30 | module.file_ext=.ios.js 31 | 32 | munge_underscores=true 33 | 34 | module.name_mapper='^react-native/\(.*\)$' -> '/node_modules/react-native/\1' 35 | 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\)$' -> '/node_modules/react-native/Libraries/Image/RelativeImageStub' 36 | 37 | suppress_type=$FlowIssue 38 | suppress_type=$FlowFixMe 39 | suppress_type=$FlowFixMeProps 40 | suppress_type=$FlowFixMeState 41 | 42 | [lints] 43 | sketchy-null-number=warn 44 | sketchy-null-mixed=warn 45 | sketchy-number=warn 46 | untyped-type-import=warn 47 | nonstrict-import=warn 48 | deprecated-type=warn 49 | unsafe-getters-setters=warn 50 | unnecessary-invariant=warn 51 | signature-verification-failure=warn 52 | 53 | [strict] 54 | deprecated-type 55 | nonstrict-import 56 | sketchy-null 57 | unclear-type 58 | unsafe-getters-setters 59 | untyped-import 60 | untyped-type-import 61 | 62 | [version] 63 | ^0.149.0 64 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | # Windows files should use crlf line endings 2 | # https://help.github.com/articles/dealing-with-line-endings/ 3 | *.bat text eol=crlf 4 | -------------------------------------------------------------------------------- /.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 | 24 | # Android/IntelliJ 25 | # 26 | build/ 27 | .idea 28 | .gradle 29 | local.properties 30 | *.iml 31 | 32 | # node.js 33 | # 34 | node_modules/ 35 | npm-debug.log 36 | yarn-error.log 37 | 38 | # BUCK 39 | buck-out/ 40 | \.buckd/ 41 | *.keystore 42 | !debug.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 | 61 | #amplify-do-not-edit-begin 62 | amplify/\#current-cloud-backend 63 | amplify/.config/local-* 64 | amplify/logs 65 | amplify/mock-data 66 | amplify/backend/amplify-meta.json 67 | amplify/backend/.temp 68 | build/ 69 | dist/ 70 | node_modules/ 71 | aws-exports.js 72 | awsconfiguration.json 73 | amplifyconfiguration.json 74 | amplifyconfiguration.dart 75 | amplify-build-config.json 76 | amplify-gradle-config.json 77 | amplifytools.xcconfig 78 | .secret-* 79 | **.sample 80 | #amplify-do-not-edit-end 81 | -------------------------------------------------------------------------------- /.prettierrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | bracketSpacing: false, 3 | jsxBracketSameLine: true, 4 | singleQuote: true, 5 | trailingComma: 'all', 6 | arrowParens: 'avoid', 7 | }; 8 | -------------------------------------------------------------------------------- /.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "files.exclude": { 3 | "amplify/.config": true, 4 | "amplify/**/*-parameters.json": true, 5 | "amplify/**/amplify.state": true, 6 | "amplify/**/transform.conf.json": true, 7 | "amplify/#current-cloud-backend": true, 8 | "amplify/backend/amplify-meta.json": true, 9 | "amplify/backend/awscloudformation": true 10 | } 11 | } -------------------------------------------------------------------------------- /.watchmanconfig: -------------------------------------------------------------------------------- 1 | {} -------------------------------------------------------------------------------- /App.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Sample React Native App 3 | * https://github.com/facebook/react-native 4 | * 5 | * @format 6 | * @flow strict-local 7 | */ 8 | 9 | import React from 'react'; 10 | import {SafeAreaView, StyleSheet, Text} from 'react-native'; 11 | import Navigation from './src/navigation'; 12 | import Amplify from 'aws-amplify'; 13 | import config from './src/aws-exports'; 14 | 15 | Amplify.configure(config); 16 | 17 | const App = () => { 18 | // Auth.signOut(); 19 | return ( 20 | 21 | 22 | 23 | ); 24 | }; 25 | 26 | const styles = StyleSheet.create({ 27 | root: { 28 | flex: 1, 29 | backgroundColor: '#F9FBFC', 30 | }, 31 | }); 32 | 33 | export default App; 34 | -------------------------------------------------------------------------------- /__tests__/App-test.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @format 3 | */ 4 | 5 | import 'react-native'; 6 | import React from 'react'; 7 | import App from '../App'; 8 | 9 | // Note: test renderer must be required after react-native. 10 | import renderer from 'react-test-renderer'; 11 | 12 | it('renders correctly', () => { 13 | renderer.create(); 14 | }); 15 | -------------------------------------------------------------------------------- /amplify/.config/project-config.json: -------------------------------------------------------------------------------- 1 | { 2 | "providers": [ 3 | "awscloudformation" 4 | ], 5 | "projectName": "Authentication", 6 | "version": "3.1", 7 | "frontend": "javascript", 8 | "javascript": { 9 | "framework": "react-native", 10 | "config": { 11 | "SourceDir": "src", 12 | "DistributionDir": "/", 13 | "BuildCommand": "npm.cmd run-script build", 14 | "StartCommand": "npm.cmd run-script start" 15 | } 16 | } 17 | } -------------------------------------------------------------------------------- /amplify/backend/auth/Authentication/cli-inputs.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "1", 3 | "cognitoConfig": { 4 | "identityPoolName": "testAuthIdentityPool", 5 | "allowUnauthenticatedIdentities": false, 6 | "resourceNameTruncated": "authen6e1b59d2", 7 | "userPoolName": "Authentication", 8 | "autoVerifiedAttributes": [ 9 | "email" 10 | ], 11 | "mfaConfiguration": "OFF", 12 | "mfaTypes": [ 13 | "SMS Text Message" 14 | ], 15 | "smsAuthenticationMessage": "Your authentication code is {####}", 16 | "smsVerificationMessage": "Your verification code is {####}", 17 | "emailVerificationSubject": "Forgot password code: {####}", 18 | "emailVerificationMessage": "Forgot password code: {####}", 19 | "defaultPasswordPolicy": false, 20 | "passwordPolicyMinLength": 7, 21 | "passwordPolicyCharacters": [], 22 | "requiredAttributes": [ 23 | "preferred_username", 24 | "email", 25 | "name" 26 | ], 27 | "aliasAttributes": [], 28 | "userpoolClientGenerateSecret": false, 29 | "userpoolClientRefreshTokenValidity": 30, 30 | "userpoolClientWriteAttributes": [], 31 | "userpoolClientReadAttributes": [], 32 | "userpoolClientLambdaRole": "Authen6e1b59d2_userpoolclient_lambda_role", 33 | "userpoolClientSetAttributes": false, 34 | "sharedId": "6e1b59d2", 35 | "resourceName": "Authentication", 36 | "authSelections": "identityPoolAndUserPool", 37 | "serviceName": "Cognito", 38 | "useDefault": "manual", 39 | "userPoolGroups": false, 40 | "userPoolGroupList": [], 41 | "adminQueries": false, 42 | "thirdPartyAuth": false, 43 | "authProviders": [], 44 | "usernameCaseSensitive": false, 45 | "useEnabledMfas": true 46 | } 47 | } -------------------------------------------------------------------------------- /amplify/backend/backend-config.json: -------------------------------------------------------------------------------- 1 | { 2 | "auth": { 3 | "Authentication": { 4 | "service": "Cognito", 5 | "providerPlugin": "awscloudformation", 6 | "dependsOn": [], 7 | "customAuth": false, 8 | "frontendAuthConfig": { 9 | "socialProviders": [], 10 | "usernameAttributes": [], 11 | "signupAttributes": [ 12 | "PREFERRED_USERNAME", 13 | "EMAIL", 14 | "NAME" 15 | ], 16 | "passwordProtectionSettings": { 17 | "passwordPolicyMinLength": 7, 18 | "passwordPolicyCharacters": [] 19 | }, 20 | "mfaConfiguration": "OFF", 21 | "mfaTypes": [ 22 | "SMS" 23 | ], 24 | "verificationMechanisms": [ 25 | "EMAIL" 26 | ] 27 | } 28 | } 29 | } 30 | } -------------------------------------------------------------------------------- /amplify/backend/tags.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "Key": "user:Stack", 4 | "Value": "{project-env}" 5 | }, 6 | { 7 | "Key": "user:Application", 8 | "Value": "{project-name}" 9 | } 10 | ] -------------------------------------------------------------------------------- /amplify/backend/types/amplify-dependent-resources-ref.d.ts: -------------------------------------------------------------------------------- 1 | export type AmplifyDependentResourcesAttributes = { 2 | "auth": { 3 | "Authentication": { 4 | "IdentityPoolId": "string", 5 | "IdentityPoolName": "string", 6 | "UserPoolId": "string", 7 | "UserPoolArn": "string", 8 | "UserPoolName": "string", 9 | "AppClientIDWeb": "string", 10 | "AppClientID": "string" 11 | } 12 | } 13 | } -------------------------------------------------------------------------------- /amplify/cli.json: -------------------------------------------------------------------------------- 1 | { 2 | "features": { 3 | "graphqltransformer": { 4 | "addmissingownerfields": true, 5 | "improvepluralization": false, 6 | "validatetypenamereservedwords": true, 7 | "useexperimentalpipelinedtransformer": true, 8 | "enableiterativegsiupdates": true, 9 | "secondarykeyasgsi": true, 10 | "skipoverridemutationinputtypes": true, 11 | "transformerversion": 2, 12 | "suppressschemamigrationprompt": true 13 | }, 14 | "frontend-ios": { 15 | "enablexcodeintegration": true 16 | }, 17 | "auth": { 18 | "enablecaseinsensitivity": true, 19 | "useinclusiveterminology": true, 20 | "breakcirculardependency": true, 21 | "forcealiasattributes": false, 22 | "useenabledmfas": true 23 | }, 24 | "codegen": { 25 | "useappsyncmodelgenplugin": true, 26 | "usedocsgeneratorplugin": true, 27 | "usetypesgeneratorplugin": true, 28 | "cleangeneratedmodelsdirectory": true, 29 | "retaincasestyle": true, 30 | "addtimestampfields": true, 31 | "handlelistnullabilitytransparently": true, 32 | "emitauthprovider": true, 33 | "generateindexrules": true, 34 | "enabledartnullsafety": true 35 | }, 36 | "appsync": { 37 | "generategraphqlpermissions": true 38 | }, 39 | "latestregionsupport": { 40 | "pinpoint": 1, 41 | "translate": 1, 42 | "transcribe": 1, 43 | "rekognition": 1, 44 | "textract": 1, 45 | "comprehend": 1 46 | }, 47 | "project": { 48 | "overrides": true 49 | } 50 | } 51 | } -------------------------------------------------------------------------------- /amplify/team-provider-info.json: -------------------------------------------------------------------------------- 1 | { 2 | "staging": { 3 | "awscloudformation": { 4 | "AuthRoleName": "amplify-authentication-staging-145852-authRole", 5 | "UnauthRoleArn": "arn:aws:iam::704219588443:role/amplify-authentication-staging-145852-unauthRole", 6 | "AuthRoleArn": "arn:aws:iam::704219588443:role/amplify-authentication-staging-145852-authRole", 7 | "Region": "eu-west-1", 8 | "DeploymentBucketName": "amplify-authentication-staging-145852-deployment", 9 | "UnauthRoleName": "amplify-authentication-staging-145852-unauthRole", 10 | "StackName": "amplify-authentication-staging-145852", 11 | "StackId": "arn:aws:cloudformation:eu-west-1:704219588443:stack/amplify-authentication-staging-145852/7bb15d20-7a01-11ec-9e72-0662103b2781", 12 | "AmplifyAppId": "d2tlji6b9rco85" 13 | }, 14 | "categories": { 15 | "auth": { 16 | "Authentication": {} 17 | } 18 | } 19 | } 20 | } -------------------------------------------------------------------------------- /android/app/_BUCK: -------------------------------------------------------------------------------- 1 | # To learn about Buck see [Docs](https://buckbuild.com/). 2 | # To run your application with Buck: 3 | # - install Buck 4 | # - `npm start` - to start the packager 5 | # - `cd android` 6 | # - `keytool -genkey -v -keystore keystores/debug.keystore -storepass android -alias androiddebugkey -keypass android -dname "CN=Android Debug,O=Android,C=US"` 7 | # - `./gradlew :app:copyDownloadableDepsToLibs` - make all Gradle compile dependencies available to Buck 8 | # - `buck install -r android/app` - compile, install and run application 9 | # 10 | 11 | load(":build_defs.bzl", "create_aar_targets", "create_jar_targets") 12 | 13 | lib_deps = [] 14 | 15 | create_aar_targets(glob(["libs/*.aar"])) 16 | 17 | create_jar_targets(glob(["libs/*.jar"])) 18 | 19 | android_library( 20 | name = "all-libs", 21 | exported_deps = lib_deps, 22 | ) 23 | 24 | android_library( 25 | name = "app-code", 26 | srcs = glob([ 27 | "src/main/java/**/*.java", 28 | ]), 29 | deps = [ 30 | ":all-libs", 31 | ":build_config", 32 | ":res", 33 | ], 34 | ) 35 | 36 | android_build_config( 37 | name = "build_config", 38 | package = "com.authenetication", 39 | ) 40 | 41 | android_resource( 42 | name = "res", 43 | package = "com.authenetication", 44 | res = "src/main/res", 45 | ) 46 | 47 | android_binary( 48 | name = "app", 49 | keystore = "//android/keystores:debug", 50 | manifest = "src/main/AndroidManifest.xml", 51 | package_type = "debug", 52 | deps = [ 53 | ":app-code", 54 | ], 55 | ) 56 | -------------------------------------------------------------------------------- /android/app/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: "com.android.application" 2 | 3 | import com.android.build.OutputFile 4 | 5 | /** 6 | * The react.gradle file registers a task for each build variant (e.g. bundleDebugJsAndAssets 7 | * and bundleReleaseJsAndAssets). 8 | * These basically call `react-native bundle` with the correct arguments during the Android build 9 | * cycle. By default, bundleDebugJsAndAssets is skipped, as in debug/dev mode we prefer to load the 10 | * bundle directly from the development server. Below you can see all the possible configurations 11 | * and their defaults. If you decide to add a configuration block, make sure to add it before the 12 | * `apply from: "../../node_modules/react-native/react.gradle"` line. 13 | * 14 | * project.ext.react = [ 15 | * // the name of the generated asset file containing your JS bundle 16 | * bundleAssetName: "index.android.bundle", 17 | * 18 | * // the entry file for bundle generation. If none specified and 19 | * // "index.android.js" exists, it will be used. Otherwise "index.js" is 20 | * // default. Can be overridden with ENTRY_FILE environment variable. 21 | * entryFile: "index.android.js", 22 | * 23 | * // https://reactnative.dev/docs/performance#enable-the-ram-format 24 | * bundleCommand: "ram-bundle", 25 | * 26 | * // whether to bundle JS and assets in debug mode 27 | * bundleInDebug: false, 28 | * 29 | * // whether to bundle JS and assets in release mode 30 | * bundleInRelease: true, 31 | * 32 | * // whether to bundle JS and assets in another build variant (if configured). 33 | * // See http://tools.android.com/tech-docs/new-build-system/user-guide#TOC-Build-Variants 34 | * // The configuration property can be in the following formats 35 | * // 'bundleIn${productFlavor}${buildType}' 36 | * // 'bundleIn${buildType}' 37 | * // bundleInFreeDebug: true, 38 | * // bundleInPaidRelease: true, 39 | * // bundleInBeta: true, 40 | * 41 | * // whether to disable dev mode in custom build variants (by default only disabled in release) 42 | * // for example: to disable dev mode in the staging build type (if configured) 43 | * devDisabledInStaging: true, 44 | * // The configuration property can be in the following formats 45 | * // 'devDisabledIn${productFlavor}${buildType}' 46 | * // 'devDisabledIn${buildType}' 47 | * 48 | * // the root of your project, i.e. where "package.json" lives 49 | * root: "../../", 50 | * 51 | * // where to put the JS bundle asset in debug mode 52 | * jsBundleDirDebug: "$buildDir/intermediates/assets/debug", 53 | * 54 | * // where to put the JS bundle asset in release mode 55 | * jsBundleDirRelease: "$buildDir/intermediates/assets/release", 56 | * 57 | * // where to put drawable resources / React Native assets, e.g. the ones you use via 58 | * // require('./image.png')), in debug mode 59 | * resourcesDirDebug: "$buildDir/intermediates/res/merged/debug", 60 | * 61 | * // where to put drawable resources / React Native assets, e.g. the ones you use via 62 | * // require('./image.png')), in release mode 63 | * resourcesDirRelease: "$buildDir/intermediates/res/merged/release", 64 | * 65 | * // by default the gradle tasks are skipped if none of the JS files or assets change; this means 66 | * // that we don't look at files in android/ or ios/ to determine whether the tasks are up to 67 | * // date; if you have any other folders that you want to ignore for performance reasons (gradle 68 | * // indexes the entire tree), add them here. Alternatively, if you have JS files in android/ 69 | * // for example, you might want to remove it from here. 70 | * inputExcludes: ["android/**", "ios/**"], 71 | * 72 | * // override which node gets called and with what additional arguments 73 | * nodeExecutableAndArgs: ["node"], 74 | * 75 | * // supply additional arguments to the packager 76 | * extraPackagerArgs: [] 77 | * ] 78 | */ 79 | 80 | project.ext.react = [ 81 | enableHermes: false, // clean and rebuild if changing 82 | ] 83 | 84 | apply from: "../../node_modules/react-native/react.gradle" 85 | 86 | /** 87 | * Set this to true to create two separate APKs instead of one: 88 | * - An APK that only works on ARM devices 89 | * - An APK that only works on x86 devices 90 | * The advantage is the size of the APK is reduced by about 4MB. 91 | * Upload all the APKs to the Play Store and people will download 92 | * the correct one based on the CPU architecture of their device. 93 | */ 94 | def enableSeparateBuildPerCPUArchitecture = false 95 | 96 | /** 97 | * Run Proguard to shrink the Java bytecode in release builds. 98 | */ 99 | def enableProguardInReleaseBuilds = false 100 | 101 | /** 102 | * The preferred build flavor of JavaScriptCore. 103 | * 104 | * For example, to use the international variant, you can use: 105 | * `def jscFlavor = 'org.webkit:android-jsc-intl:+'` 106 | * 107 | * The international variant includes ICU i18n library and necessary data 108 | * allowing to use e.g. `Date.toLocaleString` and `String.localeCompare` that 109 | * give correct results when using with locales other than en-US. Note that 110 | * this variant is about 6MiB larger per architecture than default. 111 | */ 112 | def jscFlavor = 'org.webkit:android-jsc:+' 113 | 114 | /** 115 | * Whether to enable the Hermes VM. 116 | * 117 | * This should be set on project.ext.react and mirrored here. If it is not set 118 | * on project.ext.react, JavaScript will not be compiled to Hermes Bytecode 119 | * and the benefits of using Hermes will therefore be sharply reduced. 120 | */ 121 | def enableHermes = project.ext.react.get("enableHermes", false); 122 | 123 | android { 124 | ndkVersion rootProject.ext.ndkVersion 125 | 126 | compileSdkVersion rootProject.ext.compileSdkVersion 127 | 128 | defaultConfig { 129 | applicationId "com.authenetication" 130 | minSdkVersion rootProject.ext.minSdkVersion 131 | targetSdkVersion rootProject.ext.targetSdkVersion 132 | versionCode 1 133 | versionName "1.0" 134 | } 135 | splits { 136 | abi { 137 | reset() 138 | enable enableSeparateBuildPerCPUArchitecture 139 | universalApk false // If true, also generate a universal APK 140 | include "armeabi-v7a", "x86", "arm64-v8a", "x86_64" 141 | } 142 | } 143 | signingConfigs { 144 | debug { 145 | storeFile file('debug.keystore') 146 | storePassword 'android' 147 | keyAlias 'androiddebugkey' 148 | keyPassword 'android' 149 | } 150 | } 151 | buildTypes { 152 | debug { 153 | signingConfig signingConfigs.debug 154 | } 155 | release { 156 | // Caution! In production, you need to generate your own keystore file. 157 | // see https://reactnative.dev/docs/signed-apk-android. 158 | signingConfig signingConfigs.debug 159 | minifyEnabled enableProguardInReleaseBuilds 160 | proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro" 161 | } 162 | } 163 | 164 | // applicationVariants are e.g. debug, release 165 | applicationVariants.all { variant -> 166 | variant.outputs.each { output -> 167 | // For each separate APK per architecture, set a unique version code as described here: 168 | // https://developer.android.com/studio/build/configure-apk-splits.html 169 | // Example: versionCode 1 will generate 1001 for armeabi-v7a, 1002 for x86, etc. 170 | def versionCodes = ["armeabi-v7a": 1, "x86": 2, "arm64-v8a": 3, "x86_64": 4] 171 | def abi = output.getFilter(OutputFile.ABI) 172 | if (abi != null) { // null for the universal-debug, universal-release variants 173 | output.versionCodeOverride = 174 | defaultConfig.versionCode * 1000 + versionCodes.get(abi) 175 | } 176 | 177 | } 178 | } 179 | } 180 | 181 | dependencies { 182 | implementation fileTree(dir: "libs", include: ["*.jar"]) 183 | //noinspection GradleDynamicVersion 184 | implementation "com.facebook.react:react-native:+" // From node_modules 185 | 186 | implementation "androidx.swiperefreshlayout:swiperefreshlayout:1.0.0" 187 | 188 | debugImplementation("com.facebook.flipper:flipper:${FLIPPER_VERSION}") { 189 | exclude group:'com.facebook.fbjni' 190 | } 191 | 192 | debugImplementation("com.facebook.flipper:flipper-network-plugin:${FLIPPER_VERSION}") { 193 | exclude group:'com.facebook.flipper' 194 | exclude group:'com.squareup.okhttp3', module:'okhttp' 195 | } 196 | 197 | debugImplementation("com.facebook.flipper:flipper-fresco-plugin:${FLIPPER_VERSION}") { 198 | exclude group:'com.facebook.flipper' 199 | } 200 | 201 | if (enableHermes) { 202 | def hermesPath = "../../node_modules/hermes-engine/android/"; 203 | debugImplementation files(hermesPath + "hermes-debug.aar") 204 | releaseImplementation files(hermesPath + "hermes-release.aar") 205 | } else { 206 | implementation jscFlavor 207 | } 208 | } 209 | 210 | // Run this once to be able to run the application with BUCK 211 | // puts all compile dependencies into folder libs for BUCK to use 212 | task copyDownloadableDepsToLibs(type: Copy) { 213 | from configurations.implementation 214 | into 'libs' 215 | } 216 | 217 | apply from: file("../../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesAppBuildGradle(project) 218 | -------------------------------------------------------------------------------- /android/app/build_defs.bzl: -------------------------------------------------------------------------------- 1 | """Helper definitions to glob .aar and .jar targets""" 2 | 3 | def create_aar_targets(aarfiles): 4 | for aarfile in aarfiles: 5 | name = "aars__" + aarfile[aarfile.rindex("/") + 1:aarfile.rindex(".aar")] 6 | lib_deps.append(":" + name) 7 | android_prebuilt_aar( 8 | name = name, 9 | aar = aarfile, 10 | ) 11 | 12 | def create_jar_targets(jarfiles): 13 | for jarfile in jarfiles: 14 | name = "jars__" + jarfile[jarfile.rindex("/") + 1:jarfile.rindex(".jar")] 15 | lib_deps.append(":" + name) 16 | prebuilt_jar( 17 | name = name, 18 | binary_jar = jarfile, 19 | ) 20 | -------------------------------------------------------------------------------- /android/app/debug.keystore: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Savinvadim1312/Authentication/dd3af08a6920abaf6960f8b5c9c90ccca113c960/android/app/debug.keystore -------------------------------------------------------------------------------- /android/app/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # By default, the flags in this file are appended to flags specified 3 | # in /usr/local/Cellar/android-sdk/24.3.3/tools/proguard/proguard-android.txt 4 | # You can edit the include path and order by changing the proguardFiles 5 | # directive in build.gradle. 6 | # 7 | # For more details, see 8 | # http://developer.android.com/guide/developing/tools/proguard.html 9 | 10 | # Add any project specific keep options here: 11 | -------------------------------------------------------------------------------- /android/app/src/debug/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /android/app/src/debug/java/com/authenetication/ReactNativeFlipper.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) Facebook, Inc. and its affiliates. 3 | * 4 | *

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.authenetication; 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.ReactInstanceManager; 23 | import com.facebook.react.bridge.ReactContext; 24 | import com.facebook.react.modules.network.NetworkingModule; 25 | import okhttp3.OkHttpClient; 26 | 27 | public class ReactNativeFlipper { 28 | public static void initializeFlipper(Context context, ReactInstanceManager reactInstanceManager) { 29 | if (FlipperUtils.shouldEnableFlipper(context)) { 30 | final FlipperClient client = AndroidFlipperClient.getInstance(context); 31 | 32 | client.addPlugin(new InspectorFlipperPlugin(context, DescriptorMapping.withDefaults())); 33 | client.addPlugin(new ReactFlipperPlugin()); 34 | client.addPlugin(new DatabasesFlipperPlugin(context)); 35 | client.addPlugin(new SharedPreferencesFlipperPlugin(context)); 36 | client.addPlugin(CrashReporterPlugin.getInstance()); 37 | 38 | NetworkFlipperPlugin networkFlipperPlugin = new NetworkFlipperPlugin(); 39 | NetworkingModule.setCustomClientBuilder( 40 | new NetworkingModule.CustomClientBuilder() { 41 | @Override 42 | public void apply(OkHttpClient.Builder builder) { 43 | builder.addNetworkInterceptor(new FlipperOkhttpInterceptor(networkFlipperPlugin)); 44 | } 45 | }); 46 | client.addPlugin(networkFlipperPlugin); 47 | client.start(); 48 | 49 | // Fresco Plugin needs to ensure that ImagePipelineFactory is initialized 50 | // Hence we run if after all native modules have been initialized 51 | ReactContext reactContext = reactInstanceManager.getCurrentReactContext(); 52 | if (reactContext == null) { 53 | reactInstanceManager.addReactInstanceEventListener( 54 | new ReactInstanceManager.ReactInstanceEventListener() { 55 | @Override 56 | public void onReactContextInitialized(ReactContext reactContext) { 57 | reactInstanceManager.removeReactInstanceEventListener(this); 58 | reactContext.runOnNativeModulesQueueThread( 59 | new Runnable() { 60 | @Override 61 | public void run() { 62 | client.addPlugin(new FrescoFlipperPlugin()); 63 | } 64 | }); 65 | } 66 | }); 67 | } else { 68 | client.addPlugin(new FrescoFlipperPlugin()); 69 | } 70 | } 71 | } 72 | } 73 | -------------------------------------------------------------------------------- /android/app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 13 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /android/app/src/main/java/com/authenetication/MainActivity.java: -------------------------------------------------------------------------------- 1 | package com.authenetication; 2 | 3 | import com.facebook.react.ReactActivity; 4 | import android.os.Bundle; 5 | 6 | public class MainActivity extends ReactActivity { 7 | 8 | /** 9 | * Returns the name of the main component registered from JavaScript. This is used to schedule 10 | * rendering of the component. 11 | */ 12 | @Override 13 | protected String getMainComponentName() { 14 | return "Authenetication"; 15 | } 16 | 17 | @Override 18 | protected void onCreate(Bundle savedInstanceState) { 19 | super.onCreate(null); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /android/app/src/main/java/com/authenetication/MainApplication.java: -------------------------------------------------------------------------------- 1 | package com.authenetication; 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.soloader.SoLoader; 11 | import java.lang.reflect.InvocationTargetException; 12 | import java.util.List; 13 | 14 | public class MainApplication extends Application implements ReactApplication { 15 | 16 | private final ReactNativeHost mReactNativeHost = 17 | new ReactNativeHost(this) { 18 | @Override 19 | public boolean getUseDeveloperSupport() { 20 | return BuildConfig.DEBUG; 21 | } 22 | 23 | @Override 24 | protected List getPackages() { 25 | @SuppressWarnings("UnnecessaryLocalVariable") 26 | List packages = new PackageList(this).getPackages(); 27 | // Packages that cannot be autolinked yet can be added manually here, for example: 28 | // packages.add(new MyReactNativePackage()); 29 | return packages; 30 | } 31 | 32 | @Override 33 | protected String getJSMainModuleName() { 34 | return "index"; 35 | } 36 | }; 37 | 38 | @Override 39 | public ReactNativeHost getReactNativeHost() { 40 | return mReactNativeHost; 41 | } 42 | 43 | @Override 44 | public void onCreate() { 45 | super.onCreate(); 46 | SoLoader.init(this, /* native exopackage */ false); 47 | initializeFlipper(this, getReactNativeHost().getReactInstanceManager()); 48 | } 49 | 50 | /** 51 | * Loads Flipper in React Native templates. Call this in the onCreate method with something like 52 | * initializeFlipper(this, getReactNativeHost().getReactInstanceManager()); 53 | * 54 | * @param context 55 | * @param reactInstanceManager 56 | */ 57 | private static void initializeFlipper( 58 | Context context, ReactInstanceManager reactInstanceManager) { 59 | if (BuildConfig.DEBUG) { 60 | try { 61 | /* 62 | We use reflection here to pick up the class that initializes Flipper, 63 | since Flipper library is not available in release mode 64 | */ 65 | Class aClass = Class.forName("com.authenetication.ReactNativeFlipper"); 66 | aClass 67 | .getMethod("initializeFlipper", Context.class, ReactInstanceManager.class) 68 | .invoke(null, context, reactInstanceManager); 69 | } catch (ClassNotFoundException e) { 70 | e.printStackTrace(); 71 | } catch (NoSuchMethodException e) { 72 | e.printStackTrace(); 73 | } catch (IllegalAccessException e) { 74 | e.printStackTrace(); 75 | } catch (InvocationTargetException e) { 76 | e.printStackTrace(); 77 | } 78 | } 79 | } 80 | } 81 | -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Savinvadim1312/Authentication/dd3af08a6920abaf6960f8b5c9c90ccca113c960/android/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Savinvadim1312/Authentication/dd3af08a6920abaf6960f8b5c9c90ccca113c960/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Savinvadim1312/Authentication/dd3af08a6920abaf6960f8b5c9c90ccca113c960/android/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Savinvadim1312/Authentication/dd3af08a6920abaf6960f8b5c9c90ccca113c960/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Savinvadim1312/Authentication/dd3af08a6920abaf6960f8b5c9c90ccca113c960/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Savinvadim1312/Authentication/dd3af08a6920abaf6960f8b5c9c90ccca113c960/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Savinvadim1312/Authentication/dd3af08a6920abaf6960f8b5c9c90ccca113c960/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Savinvadim1312/Authentication/dd3af08a6920abaf6960f8b5c9c90ccca113c960/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Savinvadim1312/Authentication/dd3af08a6920abaf6960f8b5c9c90ccca113c960/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Savinvadim1312/Authentication/dd3af08a6920abaf6960f8b5c9c90ccca113c960/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /android/app/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | Authenetication 3 | 4 | -------------------------------------------------------------------------------- /android/app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /android/build.gradle: -------------------------------------------------------------------------------- 1 | // Top-level build file where you can add configuration options common to all sub-projects/modules. 2 | 3 | buildscript { 4 | ext { 5 | buildToolsVersion = "30.0.2" 6 | minSdkVersion = 21 7 | compileSdkVersion = 30 8 | targetSdkVersion = 30 9 | ndkVersion = "20.1.5948944" 10 | } 11 | repositories { 12 | google() 13 | mavenCentral() 14 | } 15 | dependencies { 16 | classpath("com.android.tools.build:gradle:4.2.1") 17 | // NOTE: Do not place your application dependencies here; they belong 18 | // in the individual module build.gradle files 19 | } 20 | } 21 | 22 | allprojects { 23 | repositories { 24 | mavenCentral() 25 | mavenLocal() 26 | maven { 27 | // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm 28 | url("$rootDir/../node_modules/react-native/android") 29 | } 30 | maven { 31 | // Android JSC is installed from npm 32 | url("$rootDir/../node_modules/jsc-android/dist") 33 | } 34 | 35 | google() 36 | maven { url 'https://www.jitpack.io' } 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /android/gradle.properties: -------------------------------------------------------------------------------- 1 | # Project-wide Gradle settings. 2 | 3 | # IDE (e.g. Android Studio) users: 4 | # Gradle settings configured through the IDE *will override* 5 | # any settings specified in this file. 6 | 7 | # For more details on how to configure your build environment visit 8 | # http://www.gradle.org/docs/current/userguide/build_environment.html 9 | 10 | # Specifies the JVM arguments used for the daemon process. 11 | # The setting is particularly useful for tweaking memory settings. 12 | # Default value: -Xmx10248m -XX:MaxPermSize=256m 13 | # org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 14 | 15 | # When configured, Gradle will run in incubating parallel mode. 16 | # This option should only be used with decoupled projects. More details, visit 17 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects 18 | # org.gradle.parallel=true 19 | 20 | # AndroidX package structure to make it clearer which packages are bundled with the 21 | # Android operating system, and which are packaged with your app's APK 22 | # https://developer.android.com/topic/libraries/support-library/androidx-rn 23 | android.useAndroidX=true 24 | # Automatically convert third-party libraries to use AndroidX 25 | android.enableJetifier=true 26 | 27 | # Version of flipper SDK to use with React Native 28 | FLIPPER_VERSION=0.93.0 29 | -------------------------------------------------------------------------------- /android/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Savinvadim1312/Authentication/dd3af08a6920abaf6960f8b5c9c90ccca113c960/android/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /android/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-6.9-all.zip 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | -------------------------------------------------------------------------------- /android/gradlew: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | 3 | # 4 | # Copyright 2015 the original author or authors. 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); 7 | # you may not use this file except in compliance with the License. 8 | # You may obtain a copy of the License at 9 | # 10 | # https://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | # 18 | 19 | ############################################################################## 20 | ## 21 | ## Gradle start up script for UN*X 22 | ## 23 | ############################################################################## 24 | 25 | # Attempt to set APP_HOME 26 | # Resolve links: $0 may be a link 27 | PRG="$0" 28 | # Need this for relative symlinks. 29 | while [ -h "$PRG" ] ; do 30 | ls=`ls -ld "$PRG"` 31 | link=`expr "$ls" : '.*-> \(.*\)$'` 32 | if expr "$link" : '/.*' > /dev/null; then 33 | PRG="$link" 34 | else 35 | PRG=`dirname "$PRG"`"/$link" 36 | fi 37 | done 38 | SAVED="`pwd`" 39 | cd "`dirname \"$PRG\"`/" >/dev/null 40 | APP_HOME="`pwd -P`" 41 | cd "$SAVED" >/dev/null 42 | 43 | APP_NAME="Gradle" 44 | APP_BASE_NAME=`basename "$0"` 45 | 46 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 47 | DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' 48 | 49 | # Use the maximum available, or set MAX_FD != -1 to use that value. 50 | MAX_FD="maximum" 51 | 52 | warn () { 53 | echo "$*" 54 | } 55 | 56 | die () { 57 | echo 58 | echo "$*" 59 | echo 60 | exit 1 61 | } 62 | 63 | # OS specific support (must be 'true' or 'false'). 64 | cygwin=false 65 | msys=false 66 | darwin=false 67 | nonstop=false 68 | case "`uname`" in 69 | CYGWIN* ) 70 | cygwin=true 71 | ;; 72 | Darwin* ) 73 | darwin=true 74 | ;; 75 | MINGW* ) 76 | msys=true 77 | ;; 78 | NONSTOP* ) 79 | nonstop=true 80 | ;; 81 | esac 82 | 83 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar 84 | 85 | 86 | # Determine the Java command to use to start the JVM. 87 | if [ -n "$JAVA_HOME" ] ; then 88 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then 89 | # IBM's JDK on AIX uses strange locations for the executables 90 | JAVACMD="$JAVA_HOME/jre/sh/java" 91 | else 92 | JAVACMD="$JAVA_HOME/bin/java" 93 | fi 94 | if [ ! -x "$JAVACMD" ] ; then 95 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME 96 | 97 | Please set the JAVA_HOME variable in your environment to match the 98 | location of your Java installation." 99 | fi 100 | else 101 | JAVACMD="java" 102 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 103 | 104 | Please set the JAVA_HOME variable in your environment to match the 105 | location of your Java installation." 106 | fi 107 | 108 | # Increase the maximum file descriptors if we can. 109 | if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then 110 | MAX_FD_LIMIT=`ulimit -H -n` 111 | if [ $? -eq 0 ] ; then 112 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then 113 | MAX_FD="$MAX_FD_LIMIT" 114 | fi 115 | ulimit -n $MAX_FD 116 | if [ $? -ne 0 ] ; then 117 | warn "Could not set maximum file descriptor limit: $MAX_FD" 118 | fi 119 | else 120 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" 121 | fi 122 | fi 123 | 124 | # For Darwin, add options to specify how the application appears in the dock 125 | if $darwin; then 126 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" 127 | fi 128 | 129 | # For Cygwin or MSYS, switch paths to Windows format before running java 130 | if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then 131 | APP_HOME=`cygpath --path --mixed "$APP_HOME"` 132 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` 133 | 134 | JAVACMD=`cygpath --unix "$JAVACMD"` 135 | 136 | # We build the pattern for arguments to be converted via cygpath 137 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` 138 | SEP="" 139 | for dir in $ROOTDIRSRAW ; do 140 | ROOTDIRS="$ROOTDIRS$SEP$dir" 141 | SEP="|" 142 | done 143 | OURCYGPATTERN="(^($ROOTDIRS))" 144 | # Add a user-defined pattern to the cygpath arguments 145 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then 146 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" 147 | fi 148 | # Now convert the arguments - kludge to limit ourselves to /bin/sh 149 | i=0 150 | for arg in "$@" ; do 151 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` 152 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option 153 | 154 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition 155 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` 156 | else 157 | eval `echo args$i`="\"$arg\"" 158 | fi 159 | i=`expr $i + 1` 160 | done 161 | case $i in 162 | 0) set -- ;; 163 | 1) set -- "$args0" ;; 164 | 2) set -- "$args0" "$args1" ;; 165 | 3) set -- "$args0" "$args1" "$args2" ;; 166 | 4) set -- "$args0" "$args1" "$args2" "$args3" ;; 167 | 5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; 168 | 6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; 169 | 7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; 170 | 8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; 171 | 9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; 172 | esac 173 | fi 174 | 175 | # Escape application args 176 | save () { 177 | for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done 178 | echo " " 179 | } 180 | APP_ARGS=`save "$@"` 181 | 182 | # Collect all arguments for the java command, following the shell quoting and substitution rules 183 | eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS" 184 | 185 | exec "$JAVACMD" "$@" 186 | -------------------------------------------------------------------------------- /android/gradlew.bat: -------------------------------------------------------------------------------- 1 | @rem 2 | @rem Copyright 2015 the original author or authors. 3 | @rem 4 | @rem Licensed under the Apache License, Version 2.0 (the "License"); 5 | @rem you may not use this file except in compliance with the License. 6 | @rem You may obtain a copy of the License at 7 | @rem 8 | @rem https://www.apache.org/licenses/LICENSE-2.0 9 | @rem 10 | @rem Unless required by applicable law or agreed to in writing, software 11 | @rem distributed under the License is distributed on an "AS IS" BASIS, 12 | @rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | @rem See the License for the specific language governing permissions and 14 | @rem limitations under the License. 15 | @rem 16 | 17 | @if "%DEBUG%" == "" @echo off 18 | @rem ########################################################################## 19 | @rem 20 | @rem Gradle startup script for Windows 21 | @rem 22 | @rem ########################################################################## 23 | 24 | @rem Set local scope for the variables with windows NT shell 25 | if "%OS%"=="Windows_NT" setlocal 26 | 27 | set DIRNAME=%~dp0 28 | if "%DIRNAME%" == "" set DIRNAME=. 29 | set APP_BASE_NAME=%~n0 30 | set APP_HOME=%DIRNAME% 31 | 32 | @rem Resolve any "." and ".." in APP_HOME to make it shorter. 33 | for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi 34 | 35 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 36 | set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" 37 | 38 | @rem Find java.exe 39 | if defined JAVA_HOME goto findJavaFromJavaHome 40 | 41 | set JAVA_EXE=java.exe 42 | %JAVA_EXE% -version >NUL 2>&1 43 | if "%ERRORLEVEL%" == "0" goto execute 44 | 45 | echo. 46 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 47 | echo. 48 | echo Please set the JAVA_HOME variable in your environment to match the 49 | echo location of your Java installation. 50 | 51 | goto fail 52 | 53 | :findJavaFromJavaHome 54 | set JAVA_HOME=%JAVA_HOME:"=% 55 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 56 | 57 | if exist "%JAVA_EXE%" goto execute 58 | 59 | echo. 60 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 61 | echo. 62 | echo Please set the JAVA_HOME variable in your environment to match the 63 | echo location of your Java installation. 64 | 65 | goto fail 66 | 67 | :execute 68 | @rem Setup the command line 69 | 70 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 71 | 72 | 73 | @rem Execute Gradle 74 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* 75 | 76 | :end 77 | @rem End local scope for the variables with windows NT shell 78 | if "%ERRORLEVEL%"=="0" goto mainEnd 79 | 80 | :fail 81 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 82 | rem the _cmd.exe /c_ return code! 83 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 84 | exit /b 1 85 | 86 | :mainEnd 87 | if "%OS%"=="Windows_NT" endlocal 88 | 89 | :omega 90 | -------------------------------------------------------------------------------- /android/settings.gradle: -------------------------------------------------------------------------------- 1 | rootProject.name = 'Authenetication' 2 | apply from: file("../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesSettingsGradle(settings) 3 | include ':app' 4 | -------------------------------------------------------------------------------- /app.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Authenetication", 3 | "displayName": "Authenetication" 4 | } -------------------------------------------------------------------------------- /assets/images/Logo_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Savinvadim1312/Authentication/dd3af08a6920abaf6960f8b5c9c90ccca113c960/assets/images/Logo_1.png -------------------------------------------------------------------------------- /babel.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | presets: ['module:metro-react-native-babel-preset'], 3 | }; 4 | -------------------------------------------------------------------------------- /index.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @format 3 | */ 4 | 5 | import {AppRegistry} from 'react-native'; 6 | import App from './App'; 7 | import {name as appName} from './app.json'; 8 | 9 | AppRegistry.registerComponent(appName, () => App); 10 | -------------------------------------------------------------------------------- /ios/Authenetication.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 54; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 00E356F31AD99517003FC87E /* AutheneticationTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 00E356F21AD99517003FC87E /* AutheneticationTests.m */; }; 11 | 13B07FBC1A68108700A75B9A /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB01A68108700A75B9A /* AppDelegate.m */; }; 12 | 13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB51A68108700A75B9A /* Images.xcassets */; }; 13 | 13B07FC11A68108700A75B9A /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB71A68108700A75B9A /* main.m */; }; 14 | 81AB9BB82411601600AC10FF /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 81AB9BB72411601600AC10FF /* LaunchScreen.storyboard */; }; 15 | /* End PBXBuildFile section */ 16 | 17 | /* Begin PBXContainerItemProxy section */ 18 | 00E356F41AD99517003FC87E /* PBXContainerItemProxy */ = { 19 | isa = PBXContainerItemProxy; 20 | containerPortal = 83CBB9F71A601CBA00E9B192 /* Project object */; 21 | proxyType = 1; 22 | remoteGlobalIDString = 13B07F861A680F5B00A75B9A; 23 | remoteInfo = Authenetication; 24 | }; 25 | /* End PBXContainerItemProxy section */ 26 | 27 | /* Begin PBXFileReference section */ 28 | 00E356EE1AD99517003FC87E /* AutheneticationTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = AutheneticationTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 29 | 00E356F11AD99517003FC87E /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 30 | 00E356F21AD99517003FC87E /* AutheneticationTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AutheneticationTests.m; sourceTree = ""; }; 31 | 13B07F961A680F5B00A75B9A /* Authenetication.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Authenetication.app; sourceTree = BUILT_PRODUCTS_DIR; }; 32 | 13B07FAF1A68108700A75B9A /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AppDelegate.h; path = Authenetication/AppDelegate.h; sourceTree = ""; }; 33 | 13B07FB01A68108700A75B9A /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = AppDelegate.m; path = Authenetication/AppDelegate.m; sourceTree = ""; }; 34 | 13B07FB51A68108700A75B9A /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Images.xcassets; path = Authenetication/Images.xcassets; sourceTree = ""; }; 35 | 13B07FB61A68108700A75B9A /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = Info.plist; path = Authenetication/Info.plist; sourceTree = ""; }; 36 | 13B07FB71A68108700A75B9A /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = main.m; path = Authenetication/main.m; sourceTree = ""; }; 37 | 81AB9BB72411601600AC10FF /* LaunchScreen.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; name = LaunchScreen.storyboard; path = Authenetication/LaunchScreen.storyboard; sourceTree = ""; }; 38 | ED297162215061F000B7C4FE /* JavaScriptCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = JavaScriptCore.framework; path = System/Library/Frameworks/JavaScriptCore.framework; sourceTree = SDKROOT; }; 39 | /* End PBXFileReference section */ 40 | 41 | /* Begin PBXFrameworksBuildPhase section */ 42 | 00E356EB1AD99517003FC87E /* Frameworks */ = { 43 | isa = PBXFrameworksBuildPhase; 44 | buildActionMask = 2147483647; 45 | files = ( 46 | ); 47 | runOnlyForDeploymentPostprocessing = 0; 48 | }; 49 | 13B07F8C1A680F5B00A75B9A /* Frameworks */ = { 50 | isa = PBXFrameworksBuildPhase; 51 | buildActionMask = 2147483647; 52 | files = ( 53 | ); 54 | runOnlyForDeploymentPostprocessing = 0; 55 | }; 56 | /* End PBXFrameworksBuildPhase section */ 57 | 58 | /* Begin PBXGroup section */ 59 | 00E356EF1AD99517003FC87E /* AutheneticationTests */ = { 60 | isa = PBXGroup; 61 | children = ( 62 | 00E356F21AD99517003FC87E /* AutheneticationTests.m */, 63 | 00E356F01AD99517003FC87E /* Supporting Files */, 64 | ); 65 | path = AutheneticationTests; 66 | sourceTree = ""; 67 | }; 68 | 00E356F01AD99517003FC87E /* Supporting Files */ = { 69 | isa = PBXGroup; 70 | children = ( 71 | 00E356F11AD99517003FC87E /* Info.plist */, 72 | ); 73 | name = "Supporting Files"; 74 | sourceTree = ""; 75 | }; 76 | 13B07FAE1A68108700A75B9A /* Authenetication */ = { 77 | isa = PBXGroup; 78 | children = ( 79 | 13B07FAF1A68108700A75B9A /* AppDelegate.h */, 80 | 13B07FB01A68108700A75B9A /* AppDelegate.m */, 81 | 13B07FB51A68108700A75B9A /* Images.xcassets */, 82 | 13B07FB61A68108700A75B9A /* Info.plist */, 83 | 81AB9BB72411601600AC10FF /* LaunchScreen.storyboard */, 84 | 13B07FB71A68108700A75B9A /* main.m */, 85 | ); 86 | name = Authenetication; 87 | sourceTree = ""; 88 | }; 89 | 2D16E6871FA4F8E400B85C8A /* Frameworks */ = { 90 | isa = PBXGroup; 91 | children = ( 92 | ED297162215061F000B7C4FE /* JavaScriptCore.framework */, 93 | ); 94 | name = Frameworks; 95 | sourceTree = ""; 96 | }; 97 | 832341AE1AAA6A7D00B99B32 /* Libraries */ = { 98 | isa = PBXGroup; 99 | children = ( 100 | ); 101 | name = Libraries; 102 | sourceTree = ""; 103 | }; 104 | 83CBB9F61A601CBA00E9B192 = { 105 | isa = PBXGroup; 106 | children = ( 107 | 13B07FAE1A68108700A75B9A /* Authenetication */, 108 | 832341AE1AAA6A7D00B99B32 /* Libraries */, 109 | 00E356EF1AD99517003FC87E /* AutheneticationTests */, 110 | 83CBBA001A601CBA00E9B192 /* Products */, 111 | 2D16E6871FA4F8E400B85C8A /* Frameworks */, 112 | ); 113 | indentWidth = 2; 114 | sourceTree = ""; 115 | tabWidth = 2; 116 | usesTabs = 0; 117 | }; 118 | 83CBBA001A601CBA00E9B192 /* Products */ = { 119 | isa = PBXGroup; 120 | children = ( 121 | 13B07F961A680F5B00A75B9A /* Authenetication.app */, 122 | 00E356EE1AD99517003FC87E /* AutheneticationTests.xctest */, 123 | ); 124 | name = Products; 125 | sourceTree = ""; 126 | }; 127 | /* End PBXGroup section */ 128 | 129 | /* Begin PBXNativeTarget section */ 130 | 00E356ED1AD99517003FC87E /* AutheneticationTests */ = { 131 | isa = PBXNativeTarget; 132 | buildConfigurationList = 00E357021AD99517003FC87E /* Build configuration list for PBXNativeTarget "AutheneticationTests" */; 133 | buildPhases = ( 134 | 00E356EA1AD99517003FC87E /* Sources */, 135 | 00E356EB1AD99517003FC87E /* Frameworks */, 136 | 00E356EC1AD99517003FC87E /* Resources */, 137 | ); 138 | buildRules = ( 139 | ); 140 | dependencies = ( 141 | 00E356F51AD99517003FC87E /* PBXTargetDependency */, 142 | ); 143 | name = AutheneticationTests; 144 | productName = AutheneticationTests; 145 | productReference = 00E356EE1AD99517003FC87E /* AutheneticationTests.xctest */; 146 | productType = "com.apple.product-type.bundle.unit-test"; 147 | }; 148 | 13B07F861A680F5B00A75B9A /* Authenetication */ = { 149 | isa = PBXNativeTarget; 150 | buildConfigurationList = 13B07F931A680F5B00A75B9A /* Build configuration list for PBXNativeTarget "Authenetication" */; 151 | buildPhases = ( 152 | FD10A7F022414F080027D42C /* Start Packager */, 153 | 13B07F871A680F5B00A75B9A /* Sources */, 154 | 13B07F8C1A680F5B00A75B9A /* Frameworks */, 155 | 13B07F8E1A680F5B00A75B9A /* Resources */, 156 | 00DD1BFF1BD5951E006B06BC /* Bundle React Native code and images */, 157 | ); 158 | buildRules = ( 159 | ); 160 | dependencies = ( 161 | ); 162 | name = Authenetication; 163 | productName = Authenetication; 164 | productReference = 13B07F961A680F5B00A75B9A /* Authenetication.app */; 165 | productType = "com.apple.product-type.application"; 166 | }; 167 | /* End PBXNativeTarget section */ 168 | 169 | /* Begin PBXProject section */ 170 | 83CBB9F71A601CBA00E9B192 /* Project object */ = { 171 | isa = PBXProject; 172 | attributes = { 173 | LastUpgradeCheck = 1210; 174 | TargetAttributes = { 175 | 00E356ED1AD99517003FC87E = { 176 | CreatedOnToolsVersion = 6.2; 177 | TestTargetID = 13B07F861A680F5B00A75B9A; 178 | }; 179 | 13B07F861A680F5B00A75B9A = { 180 | LastSwiftMigration = 1120; 181 | }; 182 | }; 183 | }; 184 | buildConfigurationList = 83CBB9FA1A601CBA00E9B192 /* Build configuration list for PBXProject "Authenetication" */; 185 | compatibilityVersion = "Xcode 12.0"; 186 | developmentRegion = en; 187 | hasScannedForEncodings = 0; 188 | knownRegions = ( 189 | en, 190 | Base, 191 | ); 192 | mainGroup = 83CBB9F61A601CBA00E9B192; 193 | productRefGroup = 83CBBA001A601CBA00E9B192 /* Products */; 194 | projectDirPath = ""; 195 | projectRoot = ""; 196 | targets = ( 197 | 13B07F861A680F5B00A75B9A /* Authenetication */, 198 | 00E356ED1AD99517003FC87E /* AutheneticationTests */, 199 | ); 200 | }; 201 | /* End PBXProject section */ 202 | 203 | /* Begin PBXResourcesBuildPhase section */ 204 | 00E356EC1AD99517003FC87E /* Resources */ = { 205 | isa = PBXResourcesBuildPhase; 206 | buildActionMask = 2147483647; 207 | files = ( 208 | ); 209 | runOnlyForDeploymentPostprocessing = 0; 210 | }; 211 | 13B07F8E1A680F5B00A75B9A /* Resources */ = { 212 | isa = PBXResourcesBuildPhase; 213 | buildActionMask = 2147483647; 214 | files = ( 215 | 81AB9BB82411601600AC10FF /* LaunchScreen.storyboard in Resources */, 216 | 13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */, 217 | ); 218 | runOnlyForDeploymentPostprocessing = 0; 219 | }; 220 | /* End PBXResourcesBuildPhase section */ 221 | 222 | /* Begin PBXShellScriptBuildPhase section */ 223 | 00DD1BFF1BD5951E006B06BC /* Bundle React Native code and images */ = { 224 | isa = PBXShellScriptBuildPhase; 225 | buildActionMask = 2147483647; 226 | files = ( 227 | ); 228 | inputPaths = ( 229 | ); 230 | name = "Bundle React Native code and images"; 231 | outputPaths = ( 232 | ); 233 | runOnlyForDeploymentPostprocessing = 0; 234 | shellPath = /bin/sh; 235 | shellScript = "set -e\n\nexport NODE_BINARY=node\n../node_modules/react-native/scripts/react-native-xcode.sh\n"; 236 | }; 237 | FD10A7F022414F080027D42C /* Start Packager */ = { 238 | isa = PBXShellScriptBuildPhase; 239 | buildActionMask = 2147483647; 240 | files = ( 241 | ); 242 | inputFileListPaths = ( 243 | ); 244 | inputPaths = ( 245 | ); 246 | name = "Start Packager"; 247 | outputFileListPaths = ( 248 | ); 249 | outputPaths = ( 250 | ); 251 | runOnlyForDeploymentPostprocessing = 0; 252 | shellPath = /bin/sh; 253 | shellScript = "export RCT_METRO_PORT=\"${RCT_METRO_PORT:=8081}\"\necho \"export RCT_METRO_PORT=${RCT_METRO_PORT}\" > \"${SRCROOT}/../node_modules/react-native/scripts/.packager.env\"\nif [ -z \"${RCT_NO_LAUNCH_PACKAGER+xxx}\" ] ; then\n if nc -w 5 -z localhost ${RCT_METRO_PORT} ; then\n if ! curl -s \"http://localhost:${RCT_METRO_PORT}/status\" | grep -q \"packager-status:running\" ; then\n echo \"Port ${RCT_METRO_PORT} already in use, packager is either not running or not running correctly\"\n exit 2\n fi\n else\n open \"$SRCROOT/../node_modules/react-native/scripts/launchPackager.command\" || echo \"Can't start packager automatically\"\n fi\nfi\n"; 254 | showEnvVarsInLog = 0; 255 | }; 256 | /* End PBXShellScriptBuildPhase section */ 257 | 258 | /* Begin PBXSourcesBuildPhase section */ 259 | 00E356EA1AD99517003FC87E /* Sources */ = { 260 | isa = PBXSourcesBuildPhase; 261 | buildActionMask = 2147483647; 262 | files = ( 263 | 00E356F31AD99517003FC87E /* AutheneticationTests.m in Sources */, 264 | ); 265 | runOnlyForDeploymentPostprocessing = 0; 266 | }; 267 | 13B07F871A680F5B00A75B9A /* Sources */ = { 268 | isa = PBXSourcesBuildPhase; 269 | buildActionMask = 2147483647; 270 | files = ( 271 | 13B07FBC1A68108700A75B9A /* AppDelegate.m in Sources */, 272 | 13B07FC11A68108700A75B9A /* main.m in Sources */, 273 | ); 274 | runOnlyForDeploymentPostprocessing = 0; 275 | }; 276 | /* End PBXSourcesBuildPhase section */ 277 | 278 | /* Begin PBXTargetDependency section */ 279 | 00E356F51AD99517003FC87E /* PBXTargetDependency */ = { 280 | isa = PBXTargetDependency; 281 | target = 13B07F861A680F5B00A75B9A /* Authenetication */; 282 | targetProxy = 00E356F41AD99517003FC87E /* PBXContainerItemProxy */; 283 | }; 284 | /* End PBXTargetDependency section */ 285 | 286 | /* Begin XCBuildConfiguration section */ 287 | 00E356F61AD99517003FC87E /* Debug */ = { 288 | isa = XCBuildConfiguration; 289 | buildSettings = { 290 | BUNDLE_LOADER = "$(TEST_HOST)"; 291 | GCC_PREPROCESSOR_DEFINITIONS = ( 292 | "DEBUG=1", 293 | "$(inherited)", 294 | ); 295 | INFOPLIST_FILE = AutheneticationTests/Info.plist; 296 | IPHONEOS_DEPLOYMENT_TARGET = 11.0; 297 | LD_RUNPATH_SEARCH_PATHS = ( 298 | "$(inherited)", 299 | "@executable_path/Frameworks", 300 | "@loader_path/Frameworks", 301 | ); 302 | OTHER_LDFLAGS = ( 303 | "-ObjC", 304 | "-lc++", 305 | "$(inherited)", 306 | ); 307 | PRODUCT_BUNDLE_IDENTIFIER = "org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier)"; 308 | PRODUCT_NAME = "$(TARGET_NAME)"; 309 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Authenetication.app/Authenetication"; 310 | }; 311 | name = Debug; 312 | }; 313 | 00E356F71AD99517003FC87E /* Release */ = { 314 | isa = XCBuildConfiguration; 315 | buildSettings = { 316 | BUNDLE_LOADER = "$(TEST_HOST)"; 317 | COPY_PHASE_STRIP = NO; 318 | INFOPLIST_FILE = AutheneticationTests/Info.plist; 319 | IPHONEOS_DEPLOYMENT_TARGET = 11.0; 320 | LD_RUNPATH_SEARCH_PATHS = ( 321 | "$(inherited)", 322 | "@executable_path/Frameworks", 323 | "@loader_path/Frameworks", 324 | ); 325 | OTHER_LDFLAGS = ( 326 | "-ObjC", 327 | "-lc++", 328 | "$(inherited)", 329 | ); 330 | PRODUCT_BUNDLE_IDENTIFIER = "org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier)"; 331 | PRODUCT_NAME = "$(TARGET_NAME)"; 332 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Authenetication.app/Authenetication"; 333 | }; 334 | name = Release; 335 | }; 336 | 13B07F941A680F5B00A75B9A /* Debug */ = { 337 | isa = XCBuildConfiguration; 338 | buildSettings = { 339 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 340 | CLANG_ENABLE_MODULES = YES; 341 | CURRENT_PROJECT_VERSION = 1; 342 | ENABLE_BITCODE = NO; 343 | INFOPLIST_FILE = Authenetication/Info.plist; 344 | LD_RUNPATH_SEARCH_PATHS = ( 345 | "$(inherited)", 346 | "@executable_path/Frameworks", 347 | ); 348 | OTHER_LDFLAGS = ( 349 | "$(inherited)", 350 | "-ObjC", 351 | "-lc++", 352 | ); 353 | PRODUCT_BUNDLE_IDENTIFIER = "org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier)"; 354 | PRODUCT_NAME = Authenetication; 355 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 356 | SWIFT_VERSION = 5.0; 357 | VERSIONING_SYSTEM = "apple-generic"; 358 | }; 359 | name = Debug; 360 | }; 361 | 13B07F951A680F5B00A75B9A /* Release */ = { 362 | isa = XCBuildConfiguration; 363 | buildSettings = { 364 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 365 | CLANG_ENABLE_MODULES = YES; 366 | CURRENT_PROJECT_VERSION = 1; 367 | INFOPLIST_FILE = Authenetication/Info.plist; 368 | LD_RUNPATH_SEARCH_PATHS = ( 369 | "$(inherited)", 370 | "@executable_path/Frameworks", 371 | ); 372 | OTHER_LDFLAGS = ( 373 | "$(inherited)", 374 | "-ObjC", 375 | "-lc++", 376 | ); 377 | PRODUCT_BUNDLE_IDENTIFIER = "org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier)"; 378 | PRODUCT_NAME = Authenetication; 379 | SWIFT_VERSION = 5.0; 380 | VERSIONING_SYSTEM = "apple-generic"; 381 | }; 382 | name = Release; 383 | }; 384 | 83CBBA201A601CBA00E9B192 /* Debug */ = { 385 | isa = XCBuildConfiguration; 386 | buildSettings = { 387 | ALWAYS_SEARCH_USER_PATHS = NO; 388 | CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; 389 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 390 | CLANG_CXX_LIBRARY = "libc++"; 391 | CLANG_ENABLE_MODULES = YES; 392 | CLANG_ENABLE_OBJC_ARC = YES; 393 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 394 | CLANG_WARN_BOOL_CONVERSION = YES; 395 | CLANG_WARN_COMMA = YES; 396 | CLANG_WARN_CONSTANT_CONVERSION = YES; 397 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 398 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 399 | CLANG_WARN_EMPTY_BODY = YES; 400 | CLANG_WARN_ENUM_CONVERSION = YES; 401 | CLANG_WARN_INFINITE_RECURSION = YES; 402 | CLANG_WARN_INT_CONVERSION = YES; 403 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 404 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 405 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 406 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 407 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; 408 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 409 | CLANG_WARN_STRICT_PROTOTYPES = YES; 410 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 411 | CLANG_WARN_UNREACHABLE_CODE = YES; 412 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 413 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 414 | COPY_PHASE_STRIP = NO; 415 | ENABLE_STRICT_OBJC_MSGSEND = YES; 416 | ENABLE_TESTABILITY = YES; 417 | GCC_C_LANGUAGE_STANDARD = gnu99; 418 | GCC_DYNAMIC_NO_PIC = NO; 419 | GCC_NO_COMMON_BLOCKS = YES; 420 | GCC_OPTIMIZATION_LEVEL = 0; 421 | GCC_PREPROCESSOR_DEFINITIONS = ( 422 | "DEBUG=1", 423 | "$(inherited)", 424 | ); 425 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 426 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 427 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 428 | GCC_WARN_UNDECLARED_SELECTOR = YES; 429 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 430 | GCC_WARN_UNUSED_FUNCTION = YES; 431 | GCC_WARN_UNUSED_VARIABLE = YES; 432 | IPHONEOS_DEPLOYMENT_TARGET = 11.0; 433 | LD_RUNPATH_SEARCH_PATHS = ( 434 | /usr/lib/swift, 435 | "$(inherited)", 436 | ); 437 | LIBRARY_SEARCH_PATHS = ( 438 | "\"$(TOOLCHAIN_DIR)/usr/lib/swift/$(PLATFORM_NAME)\"", 439 | "\"$(TOOLCHAIN_DIR)/usr/lib/swift-5.0/$(PLATFORM_NAME)\"", 440 | "\"$(inherited)\"", 441 | ); 442 | MTL_ENABLE_DEBUG_INFO = YES; 443 | ONLY_ACTIVE_ARCH = YES; 444 | SDKROOT = iphoneos; 445 | }; 446 | name = Debug; 447 | }; 448 | 83CBBA211A601CBA00E9B192 /* Release */ = { 449 | isa = XCBuildConfiguration; 450 | buildSettings = { 451 | ALWAYS_SEARCH_USER_PATHS = NO; 452 | CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; 453 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 454 | CLANG_CXX_LIBRARY = "libc++"; 455 | CLANG_ENABLE_MODULES = YES; 456 | CLANG_ENABLE_OBJC_ARC = YES; 457 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 458 | CLANG_WARN_BOOL_CONVERSION = YES; 459 | CLANG_WARN_COMMA = YES; 460 | CLANG_WARN_CONSTANT_CONVERSION = YES; 461 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 462 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 463 | CLANG_WARN_EMPTY_BODY = YES; 464 | CLANG_WARN_ENUM_CONVERSION = YES; 465 | CLANG_WARN_INFINITE_RECURSION = YES; 466 | CLANG_WARN_INT_CONVERSION = YES; 467 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 468 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 469 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 470 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 471 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; 472 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 473 | CLANG_WARN_STRICT_PROTOTYPES = YES; 474 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 475 | CLANG_WARN_UNREACHABLE_CODE = YES; 476 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 477 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 478 | COPY_PHASE_STRIP = YES; 479 | ENABLE_NS_ASSERTIONS = NO; 480 | ENABLE_STRICT_OBJC_MSGSEND = YES; 481 | GCC_C_LANGUAGE_STANDARD = gnu99; 482 | GCC_NO_COMMON_BLOCKS = YES; 483 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 484 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 485 | GCC_WARN_UNDECLARED_SELECTOR = YES; 486 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 487 | GCC_WARN_UNUSED_FUNCTION = YES; 488 | GCC_WARN_UNUSED_VARIABLE = YES; 489 | IPHONEOS_DEPLOYMENT_TARGET = 11.0; 490 | LD_RUNPATH_SEARCH_PATHS = ( 491 | /usr/lib/swift, 492 | "$(inherited)", 493 | ); 494 | LIBRARY_SEARCH_PATHS = ( 495 | "\"$(TOOLCHAIN_DIR)/usr/lib/swift/$(PLATFORM_NAME)\"", 496 | "\"$(TOOLCHAIN_DIR)/usr/lib/swift-5.0/$(PLATFORM_NAME)\"", 497 | "\"$(inherited)\"", 498 | ); 499 | MTL_ENABLE_DEBUG_INFO = NO; 500 | SDKROOT = iphoneos; 501 | VALIDATE_PRODUCT = YES; 502 | }; 503 | name = Release; 504 | }; 505 | /* End XCBuildConfiguration section */ 506 | 507 | /* Begin XCConfigurationList section */ 508 | 00E357021AD99517003FC87E /* Build configuration list for PBXNativeTarget "AutheneticationTests" */ = { 509 | isa = XCConfigurationList; 510 | buildConfigurations = ( 511 | 00E356F61AD99517003FC87E /* Debug */, 512 | 00E356F71AD99517003FC87E /* Release */, 513 | ); 514 | defaultConfigurationIsVisible = 0; 515 | defaultConfigurationName = Release; 516 | }; 517 | 13B07F931A680F5B00A75B9A /* Build configuration list for PBXNativeTarget "Authenetication" */ = { 518 | isa = XCConfigurationList; 519 | buildConfigurations = ( 520 | 13B07F941A680F5B00A75B9A /* Debug */, 521 | 13B07F951A680F5B00A75B9A /* Release */, 522 | ); 523 | defaultConfigurationIsVisible = 0; 524 | defaultConfigurationName = Release; 525 | }; 526 | 83CBB9FA1A601CBA00E9B192 /* Build configuration list for PBXProject "Authenetication" */ = { 527 | isa = XCConfigurationList; 528 | buildConfigurations = ( 529 | 83CBBA201A601CBA00E9B192 /* Debug */, 530 | 83CBBA211A601CBA00E9B192 /* Release */, 531 | ); 532 | defaultConfigurationIsVisible = 0; 533 | defaultConfigurationName = Release; 534 | }; 535 | /* End XCConfigurationList section */ 536 | }; 537 | rootObject = 83CBB9F71A601CBA00E9B192 /* Project object */; 538 | } 539 | -------------------------------------------------------------------------------- /ios/Authenetication.xcodeproj/xcshareddata/xcschemes/Authenetication.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 33 | 39 | 40 | 41 | 42 | 43 | 53 | 55 | 61 | 62 | 63 | 64 | 70 | 72 | 78 | 79 | 80 | 81 | 83 | 84 | 87 | 88 | 89 | -------------------------------------------------------------------------------- /ios/Authenetication/AppDelegate.h: -------------------------------------------------------------------------------- 1 | #import 2 | #import 3 | 4 | @interface AppDelegate : UIResponder 5 | 6 | @property (nonatomic, strong) UIWindow *window; 7 | 8 | @end 9 | -------------------------------------------------------------------------------- /ios/Authenetication/AppDelegate.m: -------------------------------------------------------------------------------- 1 | #import "AppDelegate.h" 2 | 3 | #import 4 | #import 5 | #import 6 | 7 | #ifdef FB_SONARKIT_ENABLED 8 | #import 9 | #import 10 | #import 11 | #import 12 | #import 13 | #import 14 | 15 | static void InitializeFlipper(UIApplication *application) { 16 | FlipperClient *client = [FlipperClient sharedClient]; 17 | SKDescriptorMapper *layoutDescriptorMapper = [[SKDescriptorMapper alloc] initWithDefaults]; 18 | [client addPlugin:[[FlipperKitLayoutPlugin alloc] initWithRootNode:application withDescriptorMapper:layoutDescriptorMapper]]; 19 | [client addPlugin:[[FKUserDefaultsPlugin alloc] initWithSuiteName:nil]]; 20 | [client addPlugin:[FlipperKitReactPlugin new]]; 21 | [client addPlugin:[[FlipperKitNetworkPlugin alloc] initWithNetworkAdapter:[SKIOSNetworkAdapter new]]]; 22 | [client start]; 23 | } 24 | #endif 25 | 26 | @implementation AppDelegate 27 | 28 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions 29 | { 30 | #ifdef FB_SONARKIT_ENABLED 31 | InitializeFlipper(application); 32 | #endif 33 | 34 | RCTBridge *bridge = [[RCTBridge alloc] initWithDelegate:self launchOptions:launchOptions]; 35 | RCTRootView *rootView = [[RCTRootView alloc] initWithBridge:bridge 36 | moduleName:@"Authenetication" 37 | initialProperties:nil]; 38 | 39 | if (@available(iOS 13.0, *)) { 40 | rootView.backgroundColor = [UIColor systemBackgroundColor]; 41 | } else { 42 | rootView.backgroundColor = [UIColor whiteColor]; 43 | } 44 | 45 | self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds]; 46 | UIViewController *rootViewController = [UIViewController new]; 47 | rootViewController.view = rootView; 48 | self.window.rootViewController = rootViewController; 49 | [self.window makeKeyAndVisible]; 50 | return YES; 51 | } 52 | 53 | - (NSURL *)sourceURLForBridge:(RCTBridge *)bridge 54 | { 55 | #if DEBUG 56 | return [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index" fallbackResource:nil]; 57 | #else 58 | return [[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"]; 59 | #endif 60 | } 61 | 62 | @end 63 | -------------------------------------------------------------------------------- /ios/Authenetication/Images.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "29x29", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "29x29", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "40x40", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "40x40", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "60x60", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "60x60", 31 | "scale" : "3x" 32 | } 33 | ], 34 | "info" : { 35 | "version" : 1, 36 | "author" : "xcode" 37 | } 38 | } -------------------------------------------------------------------------------- /ios/Authenetication/Images.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /ios/Authenetication/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleDisplayName 8 | Authenetication 9 | CFBundleExecutable 10 | $(EXECUTABLE_NAME) 11 | CFBundleIdentifier 12 | $(PRODUCT_BUNDLE_IDENTIFIER) 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | $(PRODUCT_NAME) 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | 1.0 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | 1 25 | LSRequiresIPhoneOS 26 | 27 | NSAppTransportSecurity 28 | 29 | NSExceptionDomains 30 | 31 | localhost 32 | 33 | NSExceptionAllowsInsecureHTTPLoads 34 | 35 | 36 | 37 | 38 | NSLocationWhenInUseUsageDescription 39 | 40 | UILaunchStoryboardName 41 | LaunchScreen 42 | UIRequiredDeviceCapabilities 43 | 44 | armv7 45 | 46 | UISupportedInterfaceOrientations 47 | 48 | UIInterfaceOrientationPortrait 49 | UIInterfaceOrientationLandscapeLeft 50 | UIInterfaceOrientationLandscapeRight 51 | 52 | UIViewControllerBasedStatusBarAppearance 53 | 54 | 55 | 56 | -------------------------------------------------------------------------------- /ios/Authenetication/LaunchScreen.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 24 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | -------------------------------------------------------------------------------- /ios/Authenetication/main.m: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | #import "AppDelegate.h" 4 | 5 | int main(int argc, char * argv[]) { 6 | @autoreleasepool { 7 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /ios/AutheneticationTests/AutheneticationTests.m: -------------------------------------------------------------------------------- 1 | #import 2 | #import 3 | 4 | #import 5 | #import 6 | 7 | #define TIMEOUT_SECONDS 600 8 | #define TEXT_TO_LOOK_FOR @"Welcome to React" 9 | 10 | @interface AutheneticationTests : XCTestCase 11 | 12 | @end 13 | 14 | @implementation AutheneticationTests 15 | 16 | - (BOOL)findSubviewInView:(UIView *)view matching:(BOOL(^)(UIView *view))test 17 | { 18 | if (test(view)) { 19 | return YES; 20 | } 21 | for (UIView *subview in [view subviews]) { 22 | if ([self findSubviewInView:subview matching:test]) { 23 | return YES; 24 | } 25 | } 26 | return NO; 27 | } 28 | 29 | - (void)testRendersWelcomeScreen 30 | { 31 | UIViewController *vc = [[[RCTSharedApplication() delegate] window] rootViewController]; 32 | NSDate *date = [NSDate dateWithTimeIntervalSinceNow:TIMEOUT_SECONDS]; 33 | BOOL foundElement = NO; 34 | 35 | __block NSString *redboxError = nil; 36 | #ifdef DEBUG 37 | RCTSetLogFunction(^(RCTLogLevel level, RCTLogSource source, NSString *fileName, NSNumber *lineNumber, NSString *message) { 38 | if (level >= RCTLogLevelError) { 39 | redboxError = message; 40 | } 41 | }); 42 | #endif 43 | 44 | while ([date timeIntervalSinceNow] > 0 && !foundElement && !redboxError) { 45 | [[NSRunLoop mainRunLoop] runMode:NSDefaultRunLoopMode beforeDate:[NSDate dateWithTimeIntervalSinceNow:0.1]]; 46 | [[NSRunLoop mainRunLoop] runMode:NSRunLoopCommonModes beforeDate:[NSDate dateWithTimeIntervalSinceNow:0.1]]; 47 | 48 | foundElement = [self findSubviewInView:vc.view matching:^BOOL(UIView *view) { 49 | if ([view.accessibilityLabel isEqualToString:TEXT_TO_LOOK_FOR]) { 50 | return YES; 51 | } 52 | return NO; 53 | }]; 54 | } 55 | 56 | #ifdef DEBUG 57 | RCTSetLogFunction(RCTDefaultLogFunction); 58 | #endif 59 | 60 | XCTAssertNil(redboxError, @"RedBox error: %@", redboxError); 61 | XCTAssertTrue(foundElement, @"Couldn't find element with text '%@' in %d seconds", TEXT_TO_LOOK_FOR, TIMEOUT_SECONDS); 62 | } 63 | 64 | 65 | @end 66 | -------------------------------------------------------------------------------- /ios/AutheneticationTests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | 24 | 25 | -------------------------------------------------------------------------------- /ios/Podfile: -------------------------------------------------------------------------------- 1 | require_relative '../node_modules/react-native/scripts/react_native_pods' 2 | require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules' 3 | 4 | platform :ios, '11.0' 5 | 6 | target 'Authenetication' do 7 | config = use_native_modules! 8 | 9 | use_react_native!( 10 | :path => config[:reactNativePath], 11 | # to enable hermes on iOS, change `false` to `true` and then install pods 12 | :hermes_enabled => false 13 | ) 14 | 15 | target 'AutheneticationTests' do 16 | inherit! :complete 17 | # Pods for testing 18 | end 19 | 20 | # Enables Flipper. 21 | # 22 | # Note that if you have use_frameworks! enabled, Flipper will not work and 23 | # you should disable the next line. 24 | use_flipper!() 25 | 26 | post_install do |installer| 27 | react_native_post_install(installer) 28 | end 29 | end 30 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "authenetication", 3 | "version": "0.0.1", 4 | "private": true, 5 | "scripts": { 6 | "android": "react-native run-android", 7 | "ios": "react-native run-ios", 8 | "start": "react-native start", 9 | "test": "jest", 10 | "lint": "eslint ." 11 | }, 12 | "dependencies": { 13 | "@react-native-async-storage/async-storage": "^1.15.15", 14 | "@react-native-community/netinfo": "^7.1.7", 15 | "@react-native-picker/picker": "^2.2.1", 16 | "@react-navigation/native": "^6.0.2", 17 | "@react-navigation/native-stack": "^6.1.0", 18 | "amazon-cognito-identity-js": "^5.2.4", 19 | "aws-amplify": "^4.3.12", 20 | "aws-amplify-react-native": "^6.0.2", 21 | "react": "17.0.2", 22 | "react-hook-form": "^7.22.1", 23 | "react-native": "0.65.1", 24 | "react-native-safe-area-context": "^3.3.2", 25 | "react-native-screens": "^3.7.0" 26 | }, 27 | "devDependencies": { 28 | "@babel/core": "^7.12.9", 29 | "@babel/runtime": "^7.12.5", 30 | "@react-native-community/eslint-config": "^2.0.0", 31 | "babel-jest": "^26.6.3", 32 | "eslint": "7.14.0", 33 | "jest": "^26.6.3", 34 | "metro-react-native-babel-preset": "^0.66.0", 35 | "react-native-codegen": "^0.0.7", 36 | "react-test-renderer": "17.0.2" 37 | }, 38 | "jest": { 39 | "preset": "react-native" 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /src/components/CustomButton/CustomButton.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import {View, Text, StyleSheet, Pressable} from 'react-native'; 3 | 4 | const CustomButton = ({onPress, text, type = 'PRIMARY', bgColor, fgColor}) => { 5 | return ( 6 | 13 | 19 | {text} 20 | 21 | 22 | ); 23 | }; 24 | 25 | const styles = StyleSheet.create({ 26 | container: { 27 | width: '100%', 28 | 29 | padding: 15, 30 | marginVertical: 5, 31 | 32 | alignItems: 'center', 33 | borderRadius: 5, 34 | }, 35 | 36 | container_PRIMARY: { 37 | backgroundColor: '#3B71F3', 38 | }, 39 | 40 | container_SECONDARY: { 41 | borderColor: '#3B71F3', 42 | borderWidth: 2, 43 | }, 44 | 45 | container_TERTIARY: {}, 46 | 47 | text: { 48 | fontWeight: 'bold', 49 | color: 'white', 50 | }, 51 | 52 | text_SECONDARY: { 53 | color: '#3B71F3', 54 | }, 55 | 56 | text_TERTIARY: { 57 | color: 'gray', 58 | }, 59 | }); 60 | 61 | export default CustomButton; 62 | -------------------------------------------------------------------------------- /src/components/CustomButton/index.js: -------------------------------------------------------------------------------- 1 | export {default} from './CustomButton'; 2 | -------------------------------------------------------------------------------- /src/components/CustomInput/CustomInput.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import {View, Text, TextInput, StyleSheet} from 'react-native'; 3 | import {Controller} from 'react-hook-form'; 4 | 5 | const CustomInput = ({ 6 | control, 7 | name, 8 | rules = {}, 9 | placeholder, 10 | secureTextEntry, 11 | }) => { 12 | return ( 13 | ( 18 | <> 19 | 24 | 32 | 33 | {error && ( 34 | {error.message || 'Error'} 35 | )} 36 | 37 | )} 38 | /> 39 | ); 40 | }; 41 | 42 | const styles = StyleSheet.create({ 43 | container: { 44 | backgroundColor: 'white', 45 | width: '100%', 46 | 47 | borderColor: '#e8e8e8', 48 | borderWidth: 1, 49 | borderRadius: 5, 50 | 51 | paddingHorizontal: 10, 52 | marginVertical: 5, 53 | }, 54 | input: {}, 55 | }); 56 | 57 | export default CustomInput; 58 | -------------------------------------------------------------------------------- /src/components/CustomInput/index.js: -------------------------------------------------------------------------------- 1 | export {default} from './CustomInput'; 2 | -------------------------------------------------------------------------------- /src/components/SocialSignInButtons/SocialSignInButtons.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import {View, Text} from 'react-native'; 3 | import CustomButton from '../CustomButton'; 4 | 5 | const SocialSignInButtons = () => { 6 | const onSignInFacebook = () => { 7 | console.warn('onSignInFacebook'); 8 | }; 9 | 10 | const onSignInGoogle = () => { 11 | console.warn('onSignInGoogle'); 12 | }; 13 | 14 | const onSignInApple = () => { 15 | console.warn('onSignInApple'); 16 | }; 17 | 18 | return ( 19 | <> 20 | 26 | 32 | 38 | 39 | ); 40 | }; 41 | 42 | export default SocialSignInButtons; 43 | -------------------------------------------------------------------------------- /src/components/SocialSignInButtons/index.js: -------------------------------------------------------------------------------- 1 | export {default} from './SocialSignInButtons'; 2 | -------------------------------------------------------------------------------- /src/navigation/index.js: -------------------------------------------------------------------------------- 1 | import React, {useEffect, useState} from 'react'; 2 | import {View, ActivityIndicator} from 'react-native'; 3 | import {NavigationContainer} from '@react-navigation/native'; 4 | import {createNativeStackNavigator} from '@react-navigation/native-stack'; 5 | 6 | import SignInScreen from '../screens/SignInScreen'; 7 | import SignUpScreen from '../screens/SignUpScreen'; 8 | import ConfirmEmailScreen from '../screens/ConfirmEmailScreen'; 9 | import ForgotPasswordScreen from '../screens/ForgotPasswordScreen'; 10 | import NewPasswordScreen from '../screens/NewPasswordScreen'; 11 | import HomeScreen from '../screens/HomeScreen'; 12 | import {Auth, Hub} from 'aws-amplify'; 13 | 14 | const Stack = createNativeStackNavigator(); 15 | 16 | const Navigation = () => { 17 | const [user, setUser] = useState(undefined); 18 | 19 | const checkUser = async () => { 20 | try { 21 | const authUser = await Auth.currentAuthenticatedUser({bypassCache: true}); 22 | setUser(authUser); 23 | } catch (e) { 24 | setUser(null); 25 | } 26 | }; 27 | 28 | useEffect(() => { 29 | checkUser(); 30 | }, []); 31 | 32 | useEffect(() => { 33 | const listener = data => { 34 | if (data.payload.event === 'signIn' || data.payload.event === 'signOut') { 35 | checkUser(); 36 | } 37 | }; 38 | 39 | Hub.listen('auth', listener); 40 | return () => Hub.remove('auth', listener); 41 | }, []); 42 | 43 | if (user === undefined) { 44 | return ( 45 | 46 | 47 | 48 | ); 49 | } 50 | 51 | return ( 52 | 53 | 54 | {user ? ( 55 | 56 | ) : ( 57 | <> 58 | 59 | 60 | 61 | 65 | 66 | 67 | )} 68 | 69 | 70 | ); 71 | }; 72 | 73 | export default Navigation; 74 | -------------------------------------------------------------------------------- /src/screens/ConfirmEmailScreen/ConfirmEmailScreen.js: -------------------------------------------------------------------------------- 1 | import React, {useState} from 'react'; 2 | import {View, Text, StyleSheet, ScrollView, Alert} from 'react-native'; 3 | import CustomInput from '../../components/CustomInput'; 4 | import CustomButton from '../../components/CustomButton'; 5 | import SocialSignInButtons from '../../components/SocialSignInButtons'; 6 | import {useNavigation} from '@react-navigation/core'; 7 | import {useForm} from 'react-hook-form'; 8 | import {useRoute} from '@react-navigation/native'; 9 | import {Auth} from 'aws-amplify'; 10 | 11 | const ConfirmEmailScreen = () => { 12 | const route = useRoute(); 13 | const {control, handleSubmit, watch} = useForm({ 14 | defaultValues: {username: route?.params?.username}, 15 | }); 16 | 17 | const username = watch('username'); 18 | 19 | const navigation = useNavigation(); 20 | 21 | const onConfirmPressed = async data => { 22 | try { 23 | await Auth.confirmSignUp(data.username, data.code); 24 | navigation.navigate('SignIn'); 25 | } catch (e) { 26 | Alert.alert('Oops', e.message); 27 | } 28 | }; 29 | 30 | const onSignInPress = () => { 31 | navigation.navigate('SignIn'); 32 | }; 33 | 34 | const onResendPress = async () => { 35 | try { 36 | await Auth.resendSignUp(username); 37 | Alert.alert('Success', 'Code was resent to your email'); 38 | } catch (e) { 39 | Alert.alert('Oops', e.message); 40 | } 41 | }; 42 | 43 | return ( 44 | 45 | 46 | Confirm your email 47 | 48 | 56 | 57 | 65 | 66 | 67 | 68 | 73 | 74 | 79 | 80 | 81 | ); 82 | }; 83 | 84 | const styles = StyleSheet.create({ 85 | root: { 86 | alignItems: 'center', 87 | padding: 20, 88 | }, 89 | title: { 90 | fontSize: 24, 91 | fontWeight: 'bold', 92 | color: '#051C60', 93 | margin: 10, 94 | }, 95 | text: { 96 | color: 'gray', 97 | marginVertical: 10, 98 | }, 99 | link: { 100 | color: '#FDB075', 101 | }, 102 | }); 103 | 104 | export default ConfirmEmailScreen; 105 | -------------------------------------------------------------------------------- /src/screens/ConfirmEmailScreen/index.js: -------------------------------------------------------------------------------- 1 | export {default} from './ConfirmEmailScreen'; 2 | -------------------------------------------------------------------------------- /src/screens/ForgotPasswordScreen/ForgotPasswordScreen.js: -------------------------------------------------------------------------------- 1 | import React, {useState} from 'react'; 2 | import {View, Text, StyleSheet, ScrollView, Alert} from 'react-native'; 3 | import CustomInput from '../../components/CustomInput'; 4 | import CustomButton from '../../components/CustomButton'; 5 | import SocialSignInButtons from '../../components/SocialSignInButtons'; 6 | import {useNavigation} from '@react-navigation/core'; 7 | import {useForm} from 'react-hook-form'; 8 | import {Auth} from 'aws-amplify'; 9 | 10 | const ForgotPasswordScreen = () => { 11 | const {control, handleSubmit} = useForm(); 12 | const navigation = useNavigation(); 13 | 14 | const onSendPressed = async data => { 15 | try { 16 | await Auth.forgotPassword(data.username); 17 | navigation.navigate('NewPassword'); 18 | } catch (e) { 19 | Alert.alert('Oops', e.message); 20 | } 21 | }; 22 | 23 | const onSignInPress = () => { 24 | navigation.navigate('SignIn'); 25 | }; 26 | 27 | return ( 28 | 29 | 30 | Reset your password 31 | 32 | 40 | 41 | 42 | 43 | 48 | 49 | 50 | ); 51 | }; 52 | 53 | const styles = StyleSheet.create({ 54 | root: { 55 | alignItems: 'center', 56 | padding: 20, 57 | }, 58 | title: { 59 | fontSize: 24, 60 | fontWeight: 'bold', 61 | color: '#051C60', 62 | margin: 10, 63 | }, 64 | text: { 65 | color: 'gray', 66 | marginVertical: 10, 67 | }, 68 | link: { 69 | color: '#FDB075', 70 | }, 71 | }); 72 | 73 | export default ForgotPasswordScreen; 74 | -------------------------------------------------------------------------------- /src/screens/ForgotPasswordScreen/index.js: -------------------------------------------------------------------------------- 1 | export {default} from './ForgotPasswordScreen'; 2 | -------------------------------------------------------------------------------- /src/screens/HomeScreen/index.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import {View, Text} from 'react-native'; 3 | import {Auth} from 'aws-amplify'; 4 | 5 | const index = () => { 6 | const signOut = () => { 7 | Auth.signOut(); 8 | }; 9 | 10 | return ( 11 | 12 | Home, sweet home 13 | 23 | Sign out 24 | 25 | 26 | ); 27 | }; 28 | 29 | export default index; 30 | -------------------------------------------------------------------------------- /src/screens/NewPasswordScreen/NewPasswordScreen.js: -------------------------------------------------------------------------------- 1 | import React, {useState} from 'react'; 2 | import {View, Text, StyleSheet, ScrollView, Alert} from 'react-native'; 3 | import CustomInput from '../../components/CustomInput'; 4 | import CustomButton from '../../components/CustomButton'; 5 | import SocialSignInButtons from '../../components/SocialSignInButtons'; 6 | import {useNavigation} from '@react-navigation/native'; 7 | import {useForm} from 'react-hook-form'; 8 | import {Auth} from 'aws-amplify'; 9 | 10 | const NewPasswordScreen = () => { 11 | const {control, handleSubmit} = useForm(); 12 | 13 | const navigation = useNavigation(); 14 | 15 | const onSubmitPressed = async data => { 16 | try { 17 | await Auth.forgotPasswordSubmit(data.username, data.code, data.password); 18 | navigation.navigate('SignIn'); 19 | } catch (e) { 20 | Alert.alert('Oops', e.message); 21 | } 22 | }; 23 | 24 | const onSignInPress = () => { 25 | navigation.navigate('SignIn'); 26 | }; 27 | 28 | return ( 29 | 30 | 31 | Reset your password 32 | 33 | 39 | 40 | 46 | 47 | 60 | 61 | 62 | 63 | 68 | 69 | 70 | ); 71 | }; 72 | 73 | const styles = StyleSheet.create({ 74 | root: { 75 | alignItems: 'center', 76 | padding: 20, 77 | }, 78 | title: { 79 | fontSize: 24, 80 | fontWeight: 'bold', 81 | color: '#051C60', 82 | margin: 10, 83 | }, 84 | text: { 85 | color: 'gray', 86 | marginVertical: 10, 87 | }, 88 | link: { 89 | color: '#FDB075', 90 | }, 91 | }); 92 | 93 | export default NewPasswordScreen; 94 | -------------------------------------------------------------------------------- /src/screens/NewPasswordScreen/index.js: -------------------------------------------------------------------------------- 1 | export {default} from './NewPasswordScreen'; 2 | -------------------------------------------------------------------------------- /src/screens/SignInScreen/SignInScreen.js: -------------------------------------------------------------------------------- 1 | import React, {useState} from 'react'; 2 | import { 3 | View, 4 | Text, 5 | Image, 6 | StyleSheet, 7 | useWindowDimensions, 8 | ScrollView, 9 | TextInput, 10 | Alert, 11 | } from 'react-native'; 12 | import Logo from '../../../assets/images/Logo_1.png'; 13 | import CustomInput from '../../components/CustomInput'; 14 | import CustomButton from '../../components/CustomButton'; 15 | import SocialSignInButtons from '../../components/SocialSignInButtons'; 16 | import {useNavigation} from '@react-navigation/native'; 17 | import {useForm, Controller} from 'react-hook-form'; 18 | import {Auth} from 'aws-amplify'; 19 | 20 | const SignInScreen = () => { 21 | const {height} = useWindowDimensions(); 22 | const navigation = useNavigation(); 23 | const [loading, setLoading] = useState(false); 24 | 25 | const { 26 | control, 27 | handleSubmit, 28 | formState: {errors}, 29 | } = useForm(); 30 | 31 | const onSignInPressed = async data => { 32 | if (loading) { 33 | return; 34 | } 35 | 36 | setLoading(true); 37 | try { 38 | const response = await Auth.signIn(data.username, data.password); 39 | console.log(response); 40 | } catch (e) { 41 | Alert.alert('Oops', e.message); 42 | } 43 | setLoading(false); 44 | }; 45 | 46 | const onForgotPasswordPressed = () => { 47 | navigation.navigate('ForgotPassword'); 48 | }; 49 | 50 | const onSignUpPress = () => { 51 | navigation.navigate('SignUp'); 52 | }; 53 | 54 | return ( 55 | 56 | 57 | 62 | 63 | 69 | 70 | 83 | 84 | 88 | 89 | 94 | 95 | 96 | 97 | 102 | 103 | 104 | ); 105 | }; 106 | 107 | const styles = StyleSheet.create({ 108 | root: { 109 | alignItems: 'center', 110 | padding: 20, 111 | }, 112 | logo: { 113 | width: '70%', 114 | maxWidth: 300, 115 | maxHeight: 200, 116 | }, 117 | }); 118 | 119 | export default SignInScreen; 120 | -------------------------------------------------------------------------------- /src/screens/SignInScreen/index.js: -------------------------------------------------------------------------------- 1 | export { default } from './SignInScreen'; -------------------------------------------------------------------------------- /src/screens/SignUpScreen/SignUpScreen.js: -------------------------------------------------------------------------------- 1 | import React, {useState} from 'react'; 2 | import {View, Text, StyleSheet, ScrollView, Alert} from 'react-native'; 3 | import CustomInput from '../../components/CustomInput'; 4 | import CustomButton from '../../components/CustomButton'; 5 | import SocialSignInButtons from '../../components/SocialSignInButtons'; 6 | import {useNavigation} from '@react-navigation/core'; 7 | import {useForm} from 'react-hook-form'; 8 | import {Auth} from 'aws-amplify'; 9 | 10 | const EMAIL_REGEX = 11 | /^[a-zA-Z0-9.!#$%&’*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)*$/; 12 | 13 | const SignUpScreen = () => { 14 | const {control, handleSubmit, watch} = useForm(); 15 | const pwd = watch('password'); 16 | const navigation = useNavigation(); 17 | 18 | const onRegisterPressed = async data => { 19 | const {username, password, email, name} = data; 20 | try { 21 | await Auth.signUp({ 22 | username, 23 | password, 24 | attributes: {email, name, preferred_username: username}, 25 | }); 26 | 27 | navigation.navigate('ConfirmEmail', {username}); 28 | } catch (e) { 29 | Alert.alert('Oops', e.message); 30 | } 31 | }; 32 | 33 | const onSignInPress = () => { 34 | navigation.navigate('SignIn'); 35 | }; 36 | 37 | const onTermsOfUsePressed = () => { 38 | console.warn('onTermsOfUsePressed'); 39 | }; 40 | 41 | const onPrivacyPressed = () => { 42 | console.warn('onPrivacyPressed'); 43 | }; 44 | 45 | return ( 46 | 47 | 48 | Create an account 49 | 50 | 66 | 67 | 83 | 92 | 105 | value === pwd || 'Password do not match', 112 | }} 113 | /> 114 | 115 | 119 | 120 | 121 | By registering, you confirm that you accept our{' '} 122 | 123 | Terms of Use 124 | {' '} 125 | and{' '} 126 | 127 | Privacy Policy 128 | 129 | 130 | 131 | 132 | 133 | 138 | 139 | 140 | ); 141 | }; 142 | 143 | const styles = StyleSheet.create({ 144 | root: { 145 | alignItems: 'center', 146 | padding: 20, 147 | }, 148 | title: { 149 | fontSize: 24, 150 | fontWeight: 'bold', 151 | color: '#051C60', 152 | margin: 10, 153 | }, 154 | text: { 155 | color: 'gray', 156 | marginVertical: 10, 157 | }, 158 | link: { 159 | color: '#FDB075', 160 | }, 161 | }); 162 | 163 | export default SignUpScreen; 164 | -------------------------------------------------------------------------------- /src/screens/SignUpScreen/index.js: -------------------------------------------------------------------------------- 1 | export {default} from './SignUpScreen'; 2 | --------------------------------------------------------------------------------