@onairos/react-native 3.1.18 → 3.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +374 -403
- package/lib/commonjs/api/index.js +1 -75
- package/lib/commonjs/api/index.js.map +1 -1
- package/lib/commonjs/assets/images/email.png +0 -0
- package/lib/commonjs/assets/images/linkedin.png +0 -0
- package/lib/commonjs/assets/images/reddit.png +0 -0
- package/lib/commonjs/assets/images/youtube.png +0 -0
- package/lib/commonjs/components/DataRequestModal.js.map +1 -1
- package/lib/commonjs/components/DataRequestScreen.js.map +1 -1
- package/lib/commonjs/components/EmailVerificationModal.js.map +1 -1
- package/lib/commonjs/components/Onairos.js +3 -1
- package/lib/commonjs/components/Onairos.js.map +1 -1
- package/lib/commonjs/components/OnairosButton.js +190 -171
- package/lib/commonjs/components/OnairosButton.js.map +1 -1
- package/lib/commonjs/components/Overlay.js +5 -5
- package/lib/commonjs/components/Overlay.js.map +1 -1
- package/lib/commonjs/components/PinInput.js +120 -282
- package/lib/commonjs/components/PinInput.js.map +1 -1
- package/lib/commonjs/components/PlatformList.js.map +1 -1
- package/lib/commonjs/components/TrainingModal.js +563 -808
- package/lib/commonjs/components/TrainingModal.js.map +1 -1
- package/lib/commonjs/components/UniversalOnboarding.js +1283 -2304
- package/lib/commonjs/components/UniversalOnboarding.js.map +1 -1
- package/lib/commonjs/components/UniversalOnboarding.tsx.new +455 -0
- package/lib/commonjs/components/onboarding/OAuthWebView.js +743 -134
- package/lib/commonjs/components/onboarding/OAuthWebView.js.map +1 -1
- package/lib/commonjs/components/onboarding/OnboardingHeader.js.map +1 -1
- package/lib/commonjs/components/onboarding/PinInput.js.map +1 -1
- package/lib/commonjs/components/onboarding/PlatformConnector.js.map +1 -1
- package/lib/commonjs/components/screens/ConnectorScreen.js.map +1 -1
- package/lib/commonjs/components/screens/LoadingScreen.js.map +1 -1
- package/lib/commonjs/components/screens/PinCreationScreen.js.map +1 -1
- package/lib/commonjs/constants/index.js.map +1 -1
- package/lib/commonjs/hooks/useConnections.js +125 -120
- package/lib/commonjs/hooks/useConnections.js.map +1 -1
- package/lib/commonjs/hooks/useCredentials.js.map +1 -1
- package/lib/commonjs/index.js +31 -201
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/services/apiKeyService.js +102 -101
- package/lib/commonjs/services/apiKeyService.js.map +1 -1
- package/lib/commonjs/services/oauthService.js.map +1 -1
- package/lib/commonjs/services/platformAuthService.js +722 -956
- package/lib/commonjs/services/platformAuthService.js.map +1 -1
- package/lib/commonjs/types/ambient.d.js.map +1 -1
- package/lib/commonjs/types/declarations.d.js.map +1 -1
- package/lib/commonjs/types/index.d.js.map +1 -1
- package/lib/commonjs/types/index.js.map +1 -1
- package/lib/commonjs/types/node-fix.d.js.map +1 -1
- package/lib/commonjs/types/node-override.d.js.map +1 -1
- package/lib/commonjs/types/opacity.d.js.map +1 -1
- package/lib/commonjs/types/types.d.js.map +1 -1
- package/lib/commonjs/types.js.map +1 -1
- package/lib/commonjs/utils/Portal.js +4 -4
- package/lib/commonjs/utils/Portal.js.map +1 -1
- package/lib/commonjs/utils/api.js +24 -24
- package/lib/commonjs/utils/api.js.map +1 -1
- package/lib/commonjs/utils/auth.js +18 -18
- package/lib/commonjs/utils/auth.js.map +1 -1
- package/lib/commonjs/utils/crypto.js +13 -13
- package/lib/commonjs/utils/crypto.js.map +1 -1
- package/lib/commonjs/utils/debugHelper.js.map +1 -1
- package/lib/commonjs/utils/encryption.js +12 -12
- package/lib/commonjs/utils/encryption.js.map +1 -1
- package/lib/commonjs/utils/onairosApi.js.map +1 -1
- package/lib/commonjs/utils/programmaticFlow.js +16 -16
- package/lib/commonjs/utils/programmaticFlow.js.map +1 -1
- package/lib/commonjs/utils/retryHelper.js +27 -27
- package/lib/commonjs/utils/retryHelper.js.map +1 -1
- package/lib/commonjs/utils/secureStorage.js.map +1 -1
- package/lib/module/api/index.js +0 -72
- package/lib/module/api/index.js.map +1 -1
- package/lib/module/assets/images/email.png +0 -0
- package/lib/module/assets/images/linkedin.png +0 -0
- package/lib/module/assets/images/reddit.png +0 -0
- package/lib/module/assets/images/youtube.png +0 -0
- package/lib/module/components/DataRequestModal.js.map +1 -1
- package/lib/module/components/DataRequestScreen.js.map +1 -1
- package/lib/module/components/EmailVerificationModal.js.map +1 -1
- package/lib/module/components/Onairos.js +3 -1
- package/lib/module/components/Onairos.js.map +1 -1
- package/lib/module/components/OnairosButton.js +192 -172
- package/lib/module/components/OnairosButton.js.map +1 -1
- package/lib/module/components/Overlay.js +5 -5
- package/lib/module/components/Overlay.js.map +1 -1
- package/lib/module/components/PinInput.js +120 -283
- package/lib/module/components/PinInput.js.map +1 -1
- package/lib/module/components/PlatformList.js.map +1 -1
- package/lib/module/components/TrainingModal.js +565 -809
- package/lib/module/components/TrainingModal.js.map +1 -1
- package/lib/module/components/UniversalOnboarding.js +1284 -2307
- package/lib/module/components/UniversalOnboarding.js.map +1 -1
- package/lib/module/components/UniversalOnboarding.tsx.new +455 -0
- package/lib/module/components/onboarding/OAuthWebView.js +744 -136
- package/lib/module/components/onboarding/OAuthWebView.js.map +1 -1
- package/lib/module/components/onboarding/OnboardingHeader.js.map +1 -1
- package/lib/module/components/onboarding/PinInput.js.map +1 -1
- package/lib/module/components/onboarding/PlatformConnector.js.map +1 -1
- package/lib/module/components/screens/ConnectorScreen.js.map +1 -1
- package/lib/module/components/screens/LoadingScreen.js.map +1 -1
- package/lib/module/components/screens/PinCreationScreen.js.map +1 -1
- package/lib/module/constants/index.js.map +1 -1
- package/lib/module/hooks/useConnections.js +125 -119
- package/lib/module/hooks/useConnections.js.map +1 -1
- package/lib/module/hooks/useCredentials.js.map +1 -1
- package/lib/module/index.js +17 -55
- package/lib/module/index.js.map +1 -1
- package/lib/module/services/apiKeyService.js +102 -101
- package/lib/module/services/apiKeyService.js.map +1 -1
- package/lib/module/services/oauthService.js.map +1 -1
- package/lib/module/services/platformAuthService.js +704 -943
- package/lib/module/services/platformAuthService.js.map +1 -1
- package/lib/module/types/ambient.d.js.map +1 -1
- package/lib/module/types/declarations.d.js.map +1 -1
- package/lib/module/types/index.d.js.map +1 -1
- package/lib/module/types/index.js.map +1 -1
- package/lib/module/types/node-fix.d.js.map +1 -1
- package/lib/module/types/node-override.d.js.map +1 -1
- package/lib/module/types/opacity.d.js.map +1 -1
- package/lib/module/types/types.d.js.map +1 -1
- package/lib/module/types.js.map +1 -1
- package/lib/module/utils/Portal.js +4 -4
- package/lib/module/utils/Portal.js.map +1 -1
- package/lib/module/utils/api.js +24 -24
- package/lib/module/utils/api.js.map +1 -1
- package/lib/module/utils/auth.js +18 -18
- package/lib/module/utils/auth.js.map +1 -1
- package/lib/module/utils/crypto.js +13 -13
- package/lib/module/utils/crypto.js.map +1 -1
- package/lib/module/utils/debugHelper.js.map +1 -1
- package/lib/module/utils/encryption.js +12 -12
- package/lib/module/utils/encryption.js.map +1 -1
- package/lib/module/utils/onairosApi.js.map +1 -1
- package/lib/module/utils/programmaticFlow.js +16 -16
- package/lib/module/utils/programmaticFlow.js.map +1 -1
- package/lib/module/utils/retryHelper.js +27 -27
- package/lib/module/utils/retryHelper.js.map +1 -1
- package/lib/module/utils/secureStorage.js.map +1 -1
- package/lib/typescript/api/index.d.ts +7 -15
- package/lib/typescript/api/index.d.ts.map +1 -1
- package/lib/typescript/components/DataRequestModal.d.ts +10 -10
- package/lib/typescript/components/DataRequestScreen.d.ts +10 -10
- package/lib/typescript/components/EmailVerificationModal.d.ts +10 -10
- package/lib/typescript/components/Onairos.d.ts +3 -3
- package/lib/typescript/components/Onairos.d.ts.map +1 -1
- package/lib/typescript/components/OnairosButton.d.ts +11 -36
- package/lib/typescript/components/OnairosButton.d.ts.map +1 -1
- package/lib/typescript/components/Overlay.d.ts +3 -3
- package/lib/typescript/components/PinInput.d.ts +3 -13
- package/lib/typescript/components/PinInput.d.ts.map +1 -1
- package/lib/typescript/components/PlatformList.d.ts +3 -3
- package/lib/typescript/components/TrainingModal.d.ts +3 -14
- package/lib/typescript/components/TrainingModal.d.ts.map +1 -1
- package/lib/typescript/components/UniversalOnboarding.d.ts +3 -16
- package/lib/typescript/components/UniversalOnboarding.d.ts.map +1 -1
- package/lib/typescript/components/onboarding/OAuthWebView.d.ts +9 -9
- package/lib/typescript/components/onboarding/OAuthWebView.d.ts.map +1 -1
- package/lib/typescript/components/onboarding/OnboardingHeader.d.ts +10 -10
- package/lib/typescript/components/onboarding/PinInput.d.ts +3 -3
- package/lib/typescript/components/onboarding/PlatformConnector.d.ts +12 -12
- package/lib/typescript/components/screens/ConnectorScreen.d.ts +8 -8
- package/lib/typescript/components/screens/LoadingScreen.d.ts +8 -8
- package/lib/typescript/components/screens/PinCreationScreen.d.ts +9 -9
- package/lib/typescript/constants/index.d.ts +52 -52
- package/lib/typescript/hooks/useConnections.d.ts +8 -13
- package/lib/typescript/hooks/useConnections.d.ts.map +1 -1
- package/lib/typescript/hooks/useCredentials.d.ts +8 -8
- package/lib/typescript/index.d.ts +17 -38
- package/lib/typescript/index.d.ts.map +1 -1
- package/lib/typescript/services/apiKeyService.d.ts +131 -131
- package/lib/typescript/services/apiKeyService.d.ts.map +1 -1
- package/lib/typescript/services/oauthService.d.ts +49 -49
- package/lib/typescript/services/platformAuthService.d.ts +143 -68
- package/lib/typescript/services/platformAuthService.d.ts.map +1 -1
- package/lib/typescript/types/index.d.ts +225 -264
- package/lib/typescript/types/index.d.ts.map +1 -1
- package/lib/typescript/types.d.ts +266 -266
- package/lib/typescript/utils/Portal.d.ts +13 -13
- package/lib/typescript/utils/api.d.ts +5 -5
- package/lib/typescript/utils/auth.d.ts +5 -5
- package/lib/typescript/utils/crypto.d.ts +3 -3
- package/lib/typescript/utils/debugHelper.d.ts +28 -28
- package/lib/typescript/utils/encryption.d.ts +18 -18
- package/lib/typescript/utils/onairosApi.d.ts +86 -86
- package/lib/typescript/utils/programmaticFlow.d.ts +22 -22
- package/lib/typescript/utils/retryHelper.d.ts +68 -68
- package/lib/typescript/utils/secureStorage.d.ts +93 -93
- package/package.json +149 -145
- package/src/api/index.ts +110 -151
- package/src/assets/images/email.png +0 -0
- package/src/assets/images/linkedin.png +0 -0
- package/src/assets/images/reddit.png +0 -0
- package/src/assets/images/youtube.png +0 -0
- package/src/components/DataRequestScreen.tsx +355 -355
- package/src/components/EmailVerificationModal.tsx +363 -363
- package/src/components/Onairos.tsx +424 -422
- package/src/components/OnairosButton.tsx +359 -339
- package/src/components/Overlay.tsx +506 -506
- package/src/components/PinInput.tsx +343 -555
- package/src/components/PlatformList.tsx +144 -144
- package/src/components/TrainingModal.tsx +737 -1047
- package/src/components/UniversalOnboarding.tsx +1820 -2888
- package/src/components/UniversalOnboarding.tsx.new +455 -0
- package/src/components/onboarding/OAuthWebView.tsx +838 -232
- package/src/hooks/useConnections.ts +163 -161
- package/src/hooks/useCredentials.ts +174 -174
- package/src/index.js +14 -14
- package/src/index.ts +49 -99
- package/src/services/apiKeyService.ts +921 -919
- package/src/services/platformAuthService.ts +1113 -1346
- package/src/types/ambient.d.ts +28 -28
- package/src/types/index.ts +238 -265
- package/src/types/node-fix.d.ts +18 -18
- package/src/types/node-override.d.ts +23 -23
- package/src/types/opacity.d.ts +15 -15
- package/src/types/types.d.ts +17 -17
- package/src/utils/Portal.tsx +82 -82
- package/src/utils/api.js +111 -111
- package/src/utils/auth.js +103 -103
- package/src/utils/crypto.js +59 -59
- package/src/utils/encryption.ts +68 -68
- package/src/utils/programmaticFlow.ts +112 -112
- package/src/utils/retryHelper.ts +274 -274
- package/types/index.d.ts +213 -213
- package/types/node-env.d.ts +14 -14
- package/lib/commonjs/assets/fonts/EBGaramond-VariableFont_wght.ttf +0 -0
- package/lib/commonjs/assets/fonts/IBMPlexSans-VariableFont_wdth,wght.ttf +0 -0
- package/lib/commonjs/assets/icons/Facebookicon.png +0 -0
- package/lib/commonjs/assets/icons/Gmail.png +0 -0
- package/lib/commonjs/assets/icons/Linkedinicon.png +0 -0
- package/lib/commonjs/assets/icons/Redditicon.png +0 -0
- package/lib/commonjs/assets/icons/YouTubeicon2.png +0 -0
- package/lib/commonjs/assets/icons/YouTubeicon3.png +0 -0
- package/lib/commonjs/assets/icons/farcaster.png +0 -0
- package/lib/commonjs/assets/icons/instagram.png +0 -0
- package/lib/commonjs/assets/icons/pinterest.png +0 -0
- package/lib/commonjs/assets/icons/swerv_logo.png +0 -0
- package/lib/commonjs/assets/icons/twitter.jpg +0 -0
- package/lib/commonjs/assets/images/Checkbox.svg +0 -3
- package/lib/commonjs/assets/images/EnochE.svg +0 -19
- package/lib/commonjs/assets/images/Enochicon1.png +0 -0
- package/lib/commonjs/assets/images/Face_ID_logo.png +0 -0
- package/lib/commonjs/assets/images/Facebookicon.png +0 -0
- package/lib/commonjs/assets/images/Gmail.png +0 -0
- package/lib/commonjs/assets/images/Googlelogo.png +0 -0
- package/lib/commonjs/assets/images/Linkedinicon.png +0 -0
- package/lib/commonjs/assets/images/Onairoslogo.png +0 -0
- package/lib/commonjs/assets/images/Personalityprofile.svg +0 -3
- package/lib/commonjs/assets/images/Personalitytraits.svg +0 -3
- package/lib/commonjs/assets/images/Redditicon.png +0 -0
- package/lib/commonjs/assets/images/Userpreferences.svg +0 -3
- package/lib/commonjs/assets/images/YouTubeicon3.png +0 -0
- package/lib/commonjs/assets/images/arrow.svg +0 -20
- package/lib/commonjs/assets/images/basicproficon.svg +0 -43
- package/lib/commonjs/assets/images/basicprofile.svg +0 -3
- package/lib/commonjs/assets/images/checkmark.svg +0 -4
- package/lib/commonjs/assets/images/contentanalysis.svg +0 -3
- package/lib/commonjs/assets/images/contenticon.svg +0 -23
- package/lib/commonjs/assets/images/persona1.png +0 -0
- package/lib/commonjs/assets/images/persona2.png +0 -0
- package/lib/commonjs/assets/images/persona3.png +0 -0
- package/lib/commonjs/assets/images/persona4.png +0 -0
- package/lib/commonjs/assets/images/persona5.png +0 -0
- package/lib/commonjs/assets/images/personalityicon.svg +0 -18
- package/lib/commonjs/assets/images/x-close.svg +0 -3
- package/lib/commonjs/components/BodyText.js +0 -27
- package/lib/commonjs/components/BodyText.js.map +0 -1
- package/lib/commonjs/components/BrandMark.js +0 -44
- package/lib/commonjs/components/BrandMark.js.map +0 -1
- package/lib/commonjs/components/CodeInput.js +0 -30
- package/lib/commonjs/components/CodeInput.js.map +0 -1
- package/lib/commonjs/components/EmailInput.js +0 -30
- package/lib/commonjs/components/EmailInput.js.map +0 -1
- package/lib/commonjs/components/ExistingUserDataConfirmation.js +0 -474
- package/lib/commonjs/components/ExistingUserDataConfirmation.js.map +0 -1
- package/lib/commonjs/components/GoogleButton.js +0 -55
- package/lib/commonjs/components/GoogleButton.js.map +0 -1
- package/lib/commonjs/components/HeadingGroup.js +0 -43
- package/lib/commonjs/components/HeadingGroup.js.map +0 -1
- package/lib/commonjs/components/ModalHeader.js +0 -99
- package/lib/commonjs/components/ModalHeader.js.map +0 -1
- package/lib/commonjs/components/ModalSheet.js +0 -47
- package/lib/commonjs/components/ModalSheet.js.map +0 -1
- package/lib/commonjs/components/OnairosSignInButton.js +0 -129
- package/lib/commonjs/components/OnairosSignInButton.js.map +0 -1
- package/lib/commonjs/components/PersonaImage.js +0 -60
- package/lib/commonjs/components/PersonaImage.js.map +0 -1
- package/lib/commonjs/components/PersonaLoadingScreen.js +0 -156
- package/lib/commonjs/components/PersonaLoadingScreen.js.map +0 -1
- package/lib/commonjs/components/PersonalizationConsentScreen.js +0 -316
- package/lib/commonjs/components/PersonalizationConsentScreen.js.map +0 -1
- package/lib/commonjs/components/PinCreationScreen.js +0 -393
- package/lib/commonjs/components/PinCreationScreen.js.map +0 -1
- package/lib/commonjs/components/PlatformConnectorsStep.js +0 -828
- package/lib/commonjs/components/PlatformConnectorsStep.js.map +0 -1
- package/lib/commonjs/components/PlatformToggle.js +0 -180
- package/lib/commonjs/components/PlatformToggle.js.map +0 -1
- package/lib/commonjs/components/PrimaryButton.js +0 -180
- package/lib/commonjs/components/PrimaryButton.js.map +0 -1
- package/lib/commonjs/components/SignInMatchAnimation.js +0 -197
- package/lib/commonjs/components/SignInMatchAnimation.js.map +0 -1
- package/lib/commonjs/components/SignInStep.js +0 -179
- package/lib/commonjs/components/SignInStep.js.map +0 -1
- package/lib/commonjs/components/VerificationStep.js +0 -154
- package/lib/commonjs/components/VerificationStep.js.map +0 -1
- package/lib/commonjs/components/WelcomeScreen.js +0 -401
- package/lib/commonjs/components/WelcomeScreen.js.map +0 -1
- package/lib/commonjs/components/icons/Basicproficon.js +0 -37
- package/lib/commonjs/components/icons/Basicproficon.js.map +0 -1
- package/lib/commonjs/components/icons/Basicprofile.js +0 -21
- package/lib/commonjs/components/icons/Basicprofile.js.map +0 -1
- package/lib/commonjs/components/icons/Checkbox.js +0 -21
- package/lib/commonjs/components/icons/Checkbox.js.map +0 -1
- package/lib/commonjs/components/icons/Checkmark.js +0 -27
- package/lib/commonjs/components/icons/Checkmark.js.map +0 -1
- package/lib/commonjs/components/icons/Contentanalysis.js +0 -21
- package/lib/commonjs/components/icons/Contentanalysis.js.map +0 -1
- package/lib/commonjs/components/icons/Contenticon.js +0 -39
- package/lib/commonjs/components/icons/Contenticon.js.map +0 -1
- package/lib/commonjs/components/icons/EnochE.js +0 -41
- package/lib/commonjs/components/icons/EnochE.js.map +0 -1
- package/lib/commonjs/components/icons/Personalityicon.js +0 -30
- package/lib/commonjs/components/icons/Personalityicon.js.map +0 -1
- package/lib/commonjs/components/icons/Personalityprofile.js +0 -21
- package/lib/commonjs/components/icons/Personalityprofile.js.map +0 -1
- package/lib/commonjs/components/icons/Personalitytraits.js +0 -21
- package/lib/commonjs/components/icons/Personalitytraits.js.map +0 -1
- package/lib/commonjs/components/icons/Userpreferences.js +0 -21
- package/lib/commonjs/components/icons/Userpreferences.js.map +0 -1
- package/lib/commonjs/components/icons/index.js +0 -84
- package/lib/commonjs/components/icons/index.js.map +0 -1
- package/lib/commonjs/config/api.js +0 -34
- package/lib/commonjs/config/api.js.map +0 -1
- package/lib/commonjs/context/AuthContext.js +0 -345
- package/lib/commonjs/context/AuthContext.js.map +0 -1
- package/lib/commonjs/hooks/useConnectedAccounts.js +0 -111
- package/lib/commonjs/hooks/useConnectedAccounts.js.map +0 -1
- package/lib/commonjs/hooks/useUserConnections.js +0 -148
- package/lib/commonjs/hooks/useUserConnections.js.map +0 -1
- package/lib/commonjs/services/apiClient.js +0 -302
- package/lib/commonjs/services/apiClient.js.map +0 -1
- package/lib/commonjs/services/authService.js +0 -935
- package/lib/commonjs/services/authService.js.map +0 -1
- package/lib/commonjs/services/biometricPinService.js +0 -184
- package/lib/commonjs/services/biometricPinService.js.map +0 -1
- package/lib/commonjs/services/connectedAccountsService.js +0 -268
- package/lib/commonjs/services/connectedAccountsService.js.map +0 -1
- package/lib/commonjs/services/googleAuthService.js +0 -268
- package/lib/commonjs/services/googleAuthService.js.map +0 -1
- package/lib/commonjs/services/imageCompressionService.js +0 -260
- package/lib/commonjs/services/imageCompressionService.js.map +0 -1
- package/lib/commonjs/services/jwtStorageService.js +0 -256
- package/lib/commonjs/services/jwtStorageService.js.map +0 -1
- package/lib/commonjs/services/mobileTrainingService.js +0 -185
- package/lib/commonjs/services/mobileTrainingService.js.map +0 -1
- package/lib/commonjs/services/pinEncryptionService.js +0 -84
- package/lib/commonjs/services/pinEncryptionService.js.map +0 -1
- package/lib/commonjs/services/pinStorageUtils.js +0 -105
- package/lib/commonjs/services/pinStorageUtils.js.map +0 -1
- package/lib/commonjs/services/storageService.js +0 -404
- package/lib/commonjs/services/storageService.js.map +0 -1
- package/lib/commonjs/services/trainingApiHelpers.js +0 -73
- package/lib/commonjs/services/trainingApiHelpers.js.map +0 -1
- package/lib/commonjs/services/userConnectionsService.js +0 -486
- package/lib/commonjs/services/userConnectionsService.js.map +0 -1
- package/lib/commonjs/services/youtubeMigrationService.js +0 -415
- package/lib/commonjs/services/youtubeMigrationService.js.map +0 -1
- package/lib/commonjs/theme/index.js +0 -249
- package/lib/commonjs/theme/index.js.map +0 -1
- package/lib/commonjs/utils/eventUtils.js +0 -288
- package/lib/commonjs/utils/eventUtils.js.map +0 -1
- package/lib/commonjs/utils/haptics.js +0 -66
- package/lib/commonjs/utils/haptics.js.map +0 -1
- package/lib/commonjs/utils/imagePreloader.js +0 -6
- package/lib/commonjs/utils/imagePreloader.js.map +0 -1
- package/lib/module/assets/fonts/EBGaramond-VariableFont_wght.ttf +0 -0
- package/lib/module/assets/fonts/IBMPlexSans-VariableFont_wdth,wght.ttf +0 -0
- package/lib/module/assets/icons/Facebookicon.png +0 -0
- package/lib/module/assets/icons/Gmail.png +0 -0
- package/lib/module/assets/icons/Linkedinicon.png +0 -0
- package/lib/module/assets/icons/Redditicon.png +0 -0
- package/lib/module/assets/icons/YouTubeicon2.png +0 -0
- package/lib/module/assets/icons/YouTubeicon3.png +0 -0
- package/lib/module/assets/icons/farcaster.png +0 -0
- package/lib/module/assets/icons/instagram.png +0 -0
- package/lib/module/assets/icons/pinterest.png +0 -0
- package/lib/module/assets/icons/swerv_logo.png +0 -0
- package/lib/module/assets/icons/twitter.jpg +0 -0
- package/lib/module/assets/images/Checkbox.svg +0 -3
- package/lib/module/assets/images/EnochE.svg +0 -19
- package/lib/module/assets/images/Enochicon1.png +0 -0
- package/lib/module/assets/images/Face_ID_logo.png +0 -0
- package/lib/module/assets/images/Facebookicon.png +0 -0
- package/lib/module/assets/images/Gmail.png +0 -0
- package/lib/module/assets/images/Googlelogo.png +0 -0
- package/lib/module/assets/images/Linkedinicon.png +0 -0
- package/lib/module/assets/images/Onairoslogo.png +0 -0
- package/lib/module/assets/images/Personalityprofile.svg +0 -3
- package/lib/module/assets/images/Personalitytraits.svg +0 -3
- package/lib/module/assets/images/Redditicon.png +0 -0
- package/lib/module/assets/images/Userpreferences.svg +0 -3
- package/lib/module/assets/images/YouTubeicon3.png +0 -0
- package/lib/module/assets/images/arrow.svg +0 -20
- package/lib/module/assets/images/basicproficon.svg +0 -43
- package/lib/module/assets/images/basicprofile.svg +0 -3
- package/lib/module/assets/images/checkmark.svg +0 -4
- package/lib/module/assets/images/contentanalysis.svg +0 -3
- package/lib/module/assets/images/contenticon.svg +0 -23
- package/lib/module/assets/images/persona1.png +0 -0
- package/lib/module/assets/images/persona2.png +0 -0
- package/lib/module/assets/images/persona3.png +0 -0
- package/lib/module/assets/images/persona4.png +0 -0
- package/lib/module/assets/images/persona5.png +0 -0
- package/lib/module/assets/images/personalityicon.svg +0 -18
- package/lib/module/assets/images/x-close.svg +0 -3
- package/lib/module/components/BodyText.js +0 -20
- package/lib/module/components/BodyText.js.map +0 -1
- package/lib/module/components/BrandMark.js +0 -37
- package/lib/module/components/BrandMark.js.map +0 -1
- package/lib/module/components/CodeInput.js +0 -23
- package/lib/module/components/CodeInput.js.map +0 -1
- package/lib/module/components/EmailInput.js +0 -23
- package/lib/module/components/EmailInput.js.map +0 -1
- package/lib/module/components/ExistingUserDataConfirmation.js +0 -465
- package/lib/module/components/ExistingUserDataConfirmation.js.map +0 -1
- package/lib/module/components/GoogleButton.js +0 -48
- package/lib/module/components/GoogleButton.js.map +0 -1
- package/lib/module/components/HeadingGroup.js +0 -36
- package/lib/module/components/HeadingGroup.js.map +0 -1
- package/lib/module/components/ModalHeader.js +0 -92
- package/lib/module/components/ModalHeader.js.map +0 -1
- package/lib/module/components/ModalSheet.js +0 -39
- package/lib/module/components/ModalSheet.js.map +0 -1
- package/lib/module/components/OnairosSignInButton.js +0 -120
- package/lib/module/components/OnairosSignInButton.js.map +0 -1
- package/lib/module/components/PersonaImage.js +0 -53
- package/lib/module/components/PersonaImage.js.map +0 -1
- package/lib/module/components/PersonaLoadingScreen.js +0 -148
- package/lib/module/components/PersonaLoadingScreen.js.map +0 -1
- package/lib/module/components/PersonalizationConsentScreen.js +0 -309
- package/lib/module/components/PersonalizationConsentScreen.js.map +0 -1
- package/lib/module/components/PinCreationScreen.js +0 -386
- package/lib/module/components/PinCreationScreen.js.map +0 -1
- package/lib/module/components/PlatformConnectorsStep.js +0 -820
- package/lib/module/components/PlatformConnectorsStep.js.map +0 -1
- package/lib/module/components/PlatformToggle.js +0 -173
- package/lib/module/components/PlatformToggle.js.map +0 -1
- package/lib/module/components/PrimaryButton.js +0 -172
- package/lib/module/components/PrimaryButton.js.map +0 -1
- package/lib/module/components/SignInMatchAnimation.js +0 -189
- package/lib/module/components/SignInMatchAnimation.js.map +0 -1
- package/lib/module/components/SignInStep.js +0 -171
- package/lib/module/components/SignInStep.js.map +0 -1
- package/lib/module/components/VerificationStep.js +0 -146
- package/lib/module/components/VerificationStep.js.map +0 -1
- package/lib/module/components/WelcomeScreen.js +0 -393
- package/lib/module/components/WelcomeScreen.js.map +0 -1
- package/lib/module/components/icons/Basicproficon.js +0 -30
- package/lib/module/components/icons/Basicproficon.js.map +0 -1
- package/lib/module/components/icons/Basicprofile.js +0 -14
- package/lib/module/components/icons/Basicprofile.js.map +0 -1
- package/lib/module/components/icons/Checkbox.js +0 -14
- package/lib/module/components/icons/Checkbox.js.map +0 -1
- package/lib/module/components/icons/Checkmark.js +0 -20
- package/lib/module/components/icons/Checkmark.js.map +0 -1
- package/lib/module/components/icons/Contentanalysis.js +0 -14
- package/lib/module/components/icons/Contentanalysis.js.map +0 -1
- package/lib/module/components/icons/Contenticon.js +0 -32
- package/lib/module/components/icons/Contenticon.js.map +0 -1
- package/lib/module/components/icons/EnochE.js +0 -34
- package/lib/module/components/icons/EnochE.js.map +0 -1
- package/lib/module/components/icons/Personalityicon.js +0 -23
- package/lib/module/components/icons/Personalityicon.js.map +0 -1
- package/lib/module/components/icons/Personalityprofile.js +0 -14
- package/lib/module/components/icons/Personalityprofile.js.map +0 -1
- package/lib/module/components/icons/Personalitytraits.js +0 -14
- package/lib/module/components/icons/Personalitytraits.js.map +0 -1
- package/lib/module/components/icons/Userpreferences.js +0 -14
- package/lib/module/components/icons/Userpreferences.js.map +0 -1
- package/lib/module/components/icons/index.js +0 -13
- package/lib/module/components/icons/index.js.map +0 -1
- package/lib/module/config/api.js +0 -26
- package/lib/module/config/api.js.map +0 -1
- package/lib/module/context/AuthContext.js +0 -335
- package/lib/module/context/AuthContext.js.map +0 -1
- package/lib/module/hooks/useConnectedAccounts.js +0 -106
- package/lib/module/hooks/useConnectedAccounts.js.map +0 -1
- package/lib/module/hooks/useUserConnections.js +0 -140
- package/lib/module/hooks/useUserConnections.js.map +0 -1
- package/lib/module/services/apiClient.js +0 -298
- package/lib/module/services/apiClient.js.map +0 -1
- package/lib/module/services/authService.js +0 -905
- package/lib/module/services/authService.js.map +0 -1
- package/lib/module/services/biometricPinService.js +0 -173
- package/lib/module/services/biometricPinService.js.map +0 -1
- package/lib/module/services/connectedAccountsService.js +0 -255
- package/lib/module/services/connectedAccountsService.js.map +0 -1
- package/lib/module/services/googleAuthService.js +0 -258
- package/lib/module/services/googleAuthService.js.map +0 -1
- package/lib/module/services/imageCompressionService.js +0 -250
- package/lib/module/services/imageCompressionService.js.map +0 -1
- package/lib/module/services/jwtStorageService.js +0 -239
- package/lib/module/services/jwtStorageService.js.map +0 -1
- package/lib/module/services/mobileTrainingService.js +0 -172
- package/lib/module/services/mobileTrainingService.js.map +0 -1
- package/lib/module/services/pinEncryptionService.js +0 -75
- package/lib/module/services/pinEncryptionService.js.map +0 -1
- package/lib/module/services/pinStorageUtils.js +0 -93
- package/lib/module/services/pinStorageUtils.js.map +0 -1
- package/lib/module/services/storageService.js +0 -383
- package/lib/module/services/storageService.js.map +0 -1
- package/lib/module/services/trainingApiHelpers.js +0 -67
- package/lib/module/services/trainingApiHelpers.js.map +0 -1
- package/lib/module/services/userConnectionsService.js +0 -476
- package/lib/module/services/userConnectionsService.js.map +0 -1
- package/lib/module/services/youtubeMigrationService.js +0 -404
- package/lib/module/services/youtubeMigrationService.js.map +0 -1
- package/lib/module/theme/index.js +0 -244
- package/lib/module/theme/index.js.map +0 -1
- package/lib/module/utils/eventUtils.js +0 -270
- package/lib/module/utils/eventUtils.js.map +0 -1
- package/lib/module/utils/haptics.js +0 -59
- package/lib/module/utils/haptics.js.map +0 -1
- package/lib/module/utils/imagePreloader.js +0 -3
- package/lib/module/utils/imagePreloader.js.map +0 -1
- package/lib/typescript/components/BodyText.d.ts +0 -10
- package/lib/typescript/components/BodyText.d.ts.map +0 -1
- package/lib/typescript/components/BrandMark.d.ts +0 -11
- package/lib/typescript/components/BrandMark.d.ts.map +0 -1
- package/lib/typescript/components/CodeInput.d.ts +0 -10
- package/lib/typescript/components/CodeInput.d.ts.map +0 -1
- package/lib/typescript/components/EmailInput.d.ts +0 -8
- package/lib/typescript/components/EmailInput.d.ts.map +0 -1
- package/lib/typescript/components/ExistingUserDataConfirmation.d.ts +0 -12
- package/lib/typescript/components/ExistingUserDataConfirmation.d.ts.map +0 -1
- package/lib/typescript/components/GoogleButton.d.ts +0 -11
- package/lib/typescript/components/GoogleButton.d.ts.map +0 -1
- package/lib/typescript/components/HeadingGroup.d.ts +0 -11
- package/lib/typescript/components/HeadingGroup.d.ts.map +0 -1
- package/lib/typescript/components/ModalHeader.d.ts +0 -11
- package/lib/typescript/components/ModalHeader.d.ts.map +0 -1
- package/lib/typescript/components/ModalSheet.d.ts +0 -13
- package/lib/typescript/components/ModalSheet.d.ts.map +0 -1
- package/lib/typescript/components/OnairosSignInButton.d.ts +0 -13
- package/lib/typescript/components/OnairosSignInButton.d.ts.map +0 -1
- package/lib/typescript/components/PersonaImage.d.ts +0 -8
- package/lib/typescript/components/PersonaImage.d.ts.map +0 -1
- package/lib/typescript/components/PersonaLoadingScreen.d.ts +0 -10
- package/lib/typescript/components/PersonaLoadingScreen.d.ts.map +0 -1
- package/lib/typescript/components/PersonalizationConsentScreen.d.ts +0 -10
- package/lib/typescript/components/PersonalizationConsentScreen.d.ts.map +0 -1
- package/lib/typescript/components/PinCreationScreen.d.ts +0 -10
- package/lib/typescript/components/PinCreationScreen.d.ts.map +0 -1
- package/lib/typescript/components/PlatformConnectorsStep.d.ts +0 -11
- package/lib/typescript/components/PlatformConnectorsStep.d.ts.map +0 -1
- package/lib/typescript/components/PlatformToggle.d.ts +0 -20
- package/lib/typescript/components/PlatformToggle.d.ts.map +0 -1
- package/lib/typescript/components/PrimaryButton.d.ts +0 -22
- package/lib/typescript/components/PrimaryButton.d.ts.map +0 -1
- package/lib/typescript/components/SignInMatchAnimation.d.ts +0 -9
- package/lib/typescript/components/SignInMatchAnimation.d.ts.map +0 -1
- package/lib/typescript/components/SignInStep.d.ts +0 -12
- package/lib/typescript/components/SignInStep.d.ts.map +0 -1
- package/lib/typescript/components/VerificationStep.d.ts +0 -13
- package/lib/typescript/components/VerificationStep.d.ts.map +0 -1
- package/lib/typescript/components/WelcomeScreen.d.ts +0 -9
- package/lib/typescript/components/WelcomeScreen.d.ts.map +0 -1
- package/lib/typescript/components/icons/Basicproficon.d.ts +0 -5
- package/lib/typescript/components/icons/Basicproficon.d.ts.map +0 -1
- package/lib/typescript/components/icons/Basicprofile.d.ts +0 -5
- package/lib/typescript/components/icons/Basicprofile.d.ts.map +0 -1
- package/lib/typescript/components/icons/Checkbox.d.ts +0 -5
- package/lib/typescript/components/icons/Checkbox.d.ts.map +0 -1
- package/lib/typescript/components/icons/Checkmark.d.ts +0 -5
- package/lib/typescript/components/icons/Checkmark.d.ts.map +0 -1
- package/lib/typescript/components/icons/Contentanalysis.d.ts +0 -5
- package/lib/typescript/components/icons/Contentanalysis.d.ts.map +0 -1
- package/lib/typescript/components/icons/Contenticon.d.ts +0 -5
- package/lib/typescript/components/icons/Contenticon.d.ts.map +0 -1
- package/lib/typescript/components/icons/EnochE.d.ts +0 -5
- package/lib/typescript/components/icons/EnochE.d.ts.map +0 -1
- package/lib/typescript/components/icons/Personalityicon.d.ts +0 -5
- package/lib/typescript/components/icons/Personalityicon.d.ts.map +0 -1
- package/lib/typescript/components/icons/Personalityprofile.d.ts +0 -5
- package/lib/typescript/components/icons/Personalityprofile.d.ts.map +0 -1
- package/lib/typescript/components/icons/Personalitytraits.d.ts +0 -5
- package/lib/typescript/components/icons/Personalitytraits.d.ts.map +0 -1
- package/lib/typescript/components/icons/Userpreferences.d.ts +0 -5
- package/lib/typescript/components/icons/Userpreferences.d.ts.map +0 -1
- package/lib/typescript/components/icons/index.d.ts +0 -12
- package/lib/typescript/components/icons/index.d.ts.map +0 -1
- package/lib/typescript/config/api.d.ts +0 -24
- package/lib/typescript/config/api.d.ts.map +0 -1
- package/lib/typescript/context/AuthContext.d.ts +0 -34
- package/lib/typescript/context/AuthContext.d.ts.map +0 -1
- package/lib/typescript/hooks/useConnectedAccounts.d.ts +0 -11
- package/lib/typescript/hooks/useConnectedAccounts.d.ts.map +0 -1
- package/lib/typescript/hooks/useUserConnections.d.ts +0 -12
- package/lib/typescript/hooks/useUserConnections.d.ts.map +0 -1
- package/lib/typescript/services/apiClient.d.ts +0 -91
- package/lib/typescript/services/apiClient.d.ts.map +0 -1
- package/lib/typescript/services/authService.d.ts +0 -216
- package/lib/typescript/services/authService.d.ts.map +0 -1
- package/lib/typescript/services/biometricPinService.d.ts +0 -29
- package/lib/typescript/services/biometricPinService.d.ts.map +0 -1
- package/lib/typescript/services/connectedAccountsService.d.ts +0 -56
- package/lib/typescript/services/connectedAccountsService.d.ts.map +0 -1
- package/lib/typescript/services/googleAuthService.d.ts +0 -63
- package/lib/typescript/services/googleAuthService.d.ts.map +0 -1
- package/lib/typescript/services/imageCompressionService.d.ts +0 -37
- package/lib/typescript/services/imageCompressionService.d.ts.map +0 -1
- package/lib/typescript/services/jwtStorageService.d.ts +0 -86
- package/lib/typescript/services/jwtStorageService.d.ts.map +0 -1
- package/lib/typescript/services/mobileTrainingService.d.ts +0 -45
- package/lib/typescript/services/mobileTrainingService.d.ts.map +0 -1
- package/lib/typescript/services/pinEncryptionService.d.ts +0 -17
- package/lib/typescript/services/pinEncryptionService.d.ts.map +0 -1
- package/lib/typescript/services/pinStorageUtils.d.ts +0 -25
- package/lib/typescript/services/pinStorageUtils.d.ts.map +0 -1
- package/lib/typescript/services/storageService.d.ts +0 -128
- package/lib/typescript/services/storageService.d.ts.map +0 -1
- package/lib/typescript/services/trainingApiHelpers.d.ts +0 -38
- package/lib/typescript/services/trainingApiHelpers.d.ts.map +0 -1
- package/lib/typescript/services/userConnectionsService.d.ts +0 -90
- package/lib/typescript/services/userConnectionsService.d.ts.map +0 -1
- package/lib/typescript/services/youtubeMigrationService.d.ts +0 -12
- package/lib/typescript/services/youtubeMigrationService.d.ts.map +0 -1
- package/lib/typescript/theme/index.d.ts +0 -416
- package/lib/typescript/theme/index.d.ts.map +0 -1
- package/lib/typescript/utils/eventUtils.d.ts +0 -108
- package/lib/typescript/utils/eventUtils.d.ts.map +0 -1
- package/lib/typescript/utils/haptics.d.ts +0 -11
- package/lib/typescript/utils/haptics.d.ts.map +0 -1
- package/lib/typescript/utils/imagePreloader.d.ts +0 -2
- package/lib/typescript/utils/imagePreloader.d.ts.map +0 -1
- package/src/assets/fonts/EBGaramond-VariableFont_wght.ttf +0 -0
- package/src/assets/fonts/IBMPlexSans-VariableFont_wdth,wght.ttf +0 -0
- package/src/assets/icons/Facebookicon.png +0 -0
- package/src/assets/icons/Gmail.png +0 -0
- package/src/assets/icons/Linkedinicon.png +0 -0
- package/src/assets/icons/Redditicon.png +0 -0
- package/src/assets/icons/YouTubeicon2.png +0 -0
- package/src/assets/icons/YouTubeicon3.png +0 -0
- package/src/assets/icons/farcaster.png +0 -0
- package/src/assets/icons/instagram.png +0 -0
- package/src/assets/icons/pinterest.png +0 -0
- package/src/assets/icons/swerv_logo.png +0 -0
- package/src/assets/icons/twitter.jpg +0 -0
- package/src/assets/images/Checkbox.svg +0 -3
- package/src/assets/images/EnochE.svg +0 -19
- package/src/assets/images/Enochicon1.png +0 -0
- package/src/assets/images/Face_ID_logo.png +0 -0
- package/src/assets/images/Facebookicon.png +0 -0
- package/src/assets/images/Gmail.png +0 -0
- package/src/assets/images/Googlelogo.png +0 -0
- package/src/assets/images/Linkedinicon.png +0 -0
- package/src/assets/images/Onairoslogo.png +0 -0
- package/src/assets/images/Personalityprofile.svg +0 -3
- package/src/assets/images/Personalitytraits.svg +0 -3
- package/src/assets/images/Redditicon.png +0 -0
- package/src/assets/images/Userpreferences.svg +0 -3
- package/src/assets/images/YouTubeicon3.png +0 -0
- package/src/assets/images/arrow.svg +0 -20
- package/src/assets/images/basicproficon.svg +0 -43
- package/src/assets/images/basicprofile.svg +0 -3
- package/src/assets/images/checkmark.svg +0 -4
- package/src/assets/images/contentanalysis.svg +0 -3
- package/src/assets/images/contenticon.svg +0 -23
- package/src/assets/images/persona1.png +0 -0
- package/src/assets/images/persona2.png +0 -0
- package/src/assets/images/persona3.png +0 -0
- package/src/assets/images/persona4.png +0 -0
- package/src/assets/images/persona5.png +0 -0
- package/src/assets/images/personalityicon.svg +0 -18
- package/src/assets/images/x-close.svg +0 -3
- package/src/components/BodyText.tsx +0 -33
- package/src/components/BrandMark.tsx +0 -62
- package/src/components/CodeInput.tsx +0 -32
- package/src/components/EmailInput.tsx +0 -31
- package/src/components/ExistingUserDataConfirmation.tsx +0 -507
- package/src/components/GoogleButton.tsx +0 -55
- package/src/components/HeadingGroup.tsx +0 -49
- package/src/components/ModalHeader.tsx +0 -125
- package/src/components/ModalSheet.tsx +0 -59
- package/src/components/OnairosSignInButton.tsx +0 -132
- package/src/components/PersonaImage.tsx +0 -79
- package/src/components/PersonaLoadingScreen.tsx +0 -201
- package/src/components/PersonalizationConsentScreen.tsx +0 -410
- package/src/components/PinCreationScreen.tsx +0 -492
- package/src/components/PlatformConnectorsStep.tsx +0 -892
- package/src/components/PlatformToggle.tsx +0 -226
- package/src/components/PrimaryButton.tsx +0 -214
- package/src/components/SignInMatchAnimation.tsx +0 -225
- package/src/components/SignInStep.tsx +0 -217
- package/src/components/VerificationStep.tsx +0 -198
- package/src/components/WelcomeScreen.tsx +0 -490
- package/src/components/icons/Basicproficon.tsx +0 -30
- package/src/components/icons/Basicprofile.tsx +0 -17
- package/src/components/icons/Checkbox.tsx +0 -17
- package/src/components/icons/Checkmark.tsx +0 -24
- package/src/components/icons/Contentanalysis.tsx +0 -17
- package/src/components/icons/Contenticon.tsx +0 -30
- package/src/components/icons/EnochE.tsx +0 -39
- package/src/components/icons/Personalityicon.tsx +0 -22
- package/src/components/icons/Personalityprofile.tsx +0 -17
- package/src/components/icons/Personalitytraits.tsx +0 -17
- package/src/components/icons/Userpreferences.tsx +0 -17
- package/src/components/icons/index.ts +0 -12
- package/src/config/api.ts +0 -25
- package/src/context/AuthContext.tsx +0 -393
- package/src/hooks/useConnectedAccounts.ts +0 -139
- package/src/hooks/useUserConnections.ts +0 -166
- package/src/services/apiClient.ts +0 -337
- package/src/services/authService.ts +0 -1008
- package/src/services/biometricPinService.ts +0 -193
- package/src/services/connectedAccountsService.ts +0 -290
- package/src/services/googleAuthService.ts +0 -279
- package/src/services/imageCompressionService.ts +0 -303
- package/src/services/jwtStorageService.ts +0 -257
- package/src/services/mobileTrainingService.ts +0 -204
- package/src/services/pinEncryptionService.ts +0 -76
- package/src/services/pinStorageUtils.ts +0 -97
- package/src/services/storageService.ts +0 -452
- package/src/services/trainingApiHelpers.ts +0 -67
- package/src/services/userConnectionsService.ts +0 -557
- package/src/services/youtubeMigrationService.ts +0 -454
- package/src/theme/index.ts +0 -239
- package/src/utils/eventUtils.ts +0 -303
- package/src/utils/haptics.ts +0 -59
- package/src/utils/imagePreloader.ts +0 -2
|
@@ -1,232 +1,838 @@
|
|
|
1
|
-
import React, { useState } from 'react';
|
|
2
|
-
import {
|
|
3
|
-
View,
|
|
4
|
-
Text,
|
|
5
|
-
StyleSheet,
|
|
6
|
-
TouchableOpacity,
|
|
7
|
-
ActivityIndicator,
|
|
8
|
-
SafeAreaView,
|
|
9
|
-
Dimensions,
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
}
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
1
|
+
import React, { useState, useRef } from 'react';
|
|
2
|
+
import {
|
|
3
|
+
View,
|
|
4
|
+
Text,
|
|
5
|
+
StyleSheet,
|
|
6
|
+
TouchableOpacity,
|
|
7
|
+
ActivityIndicator,
|
|
8
|
+
SafeAreaView,
|
|
9
|
+
Dimensions,
|
|
10
|
+
Linking,
|
|
11
|
+
} from 'react-native';
|
|
12
|
+
import { WebView } from 'react-native-webview';
|
|
13
|
+
import Icon from 'react-native-vector-icons/MaterialIcons';
|
|
14
|
+
import { COLORS } from '../../constants';
|
|
15
|
+
|
|
16
|
+
const { width, height } = Dimensions.get('window');
|
|
17
|
+
|
|
18
|
+
export interface OAuthWebViewProps {
|
|
19
|
+
url: string;
|
|
20
|
+
onClose: () => void;
|
|
21
|
+
onSuccess: (code: string) => void;
|
|
22
|
+
platform?: string;
|
|
23
|
+
onComplete?: () => void;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export const OAuthWebView: React.FC<OAuthWebViewProps> = ({
|
|
27
|
+
url,
|
|
28
|
+
onClose,
|
|
29
|
+
onSuccess,
|
|
30
|
+
platform = 'platform',
|
|
31
|
+
onComplete,
|
|
32
|
+
}) => {
|
|
33
|
+
const [isLoading, setIsLoading] = useState(true);
|
|
34
|
+
const [error, setError] = useState<string | null>(null);
|
|
35
|
+
const [errorMessage, setErrorMessage] = useState<string>('');
|
|
36
|
+
const [isRetryable, setIsRetryable] = useState(true);
|
|
37
|
+
const [retryCount, setRetryCount] = useState(0);
|
|
38
|
+
const webViewRef = useRef<WebView>(null);
|
|
39
|
+
const timeoutRef = useRef<ReturnType<typeof setTimeout> | null>(null);
|
|
40
|
+
|
|
41
|
+
console.log('🌐 Opening OAuth WebView with URL:', url);
|
|
42
|
+
console.log('🔗 Platform:', platform);
|
|
43
|
+
console.log('📱 URL Components:', {
|
|
44
|
+
protocol: url.split('://')[0],
|
|
45
|
+
domain: url.split('://')[1]?.split('/')[0],
|
|
46
|
+
path: url.split('://')[1]?.split('/').slice(1).join('/'),
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
// Set up timeout for OAuth flow
|
|
50
|
+
React.useEffect(() => {
|
|
51
|
+
// Clear any existing timeout
|
|
52
|
+
if (timeoutRef.current) {
|
|
53
|
+
clearTimeout(timeoutRef.current);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
// Set a 60-second timeout for OAuth completion
|
|
57
|
+
timeoutRef.current = setTimeout(() => {
|
|
58
|
+
console.log('OAuth flow timeout - no completion detected');
|
|
59
|
+
setError('OAuth flow is taking too long. Please try again or use the browser option.');
|
|
60
|
+
setIsLoading(false);
|
|
61
|
+
}, 60000);
|
|
62
|
+
|
|
63
|
+
return () => {
|
|
64
|
+
if (timeoutRef.current) {
|
|
65
|
+
clearTimeout(timeoutRef.current);
|
|
66
|
+
}
|
|
67
|
+
};
|
|
68
|
+
}, [url]);
|
|
69
|
+
|
|
70
|
+
// Clear timeout when component unmounts or OAuth completes
|
|
71
|
+
React.useEffect(() => {
|
|
72
|
+
return () => {
|
|
73
|
+
if (timeoutRef.current) {
|
|
74
|
+
clearTimeout(timeoutRef.current);
|
|
75
|
+
}
|
|
76
|
+
};
|
|
77
|
+
}, []);
|
|
78
|
+
|
|
79
|
+
const onNavigationStateChange = (navState: any) => {
|
|
80
|
+
const currentUrl = navState.url;
|
|
81
|
+
console.log('🌐 Navigation state changed:', {
|
|
82
|
+
url: currentUrl,
|
|
83
|
+
canGoBack: navState.canGoBack,
|
|
84
|
+
canGoForward: navState.canGoForward,
|
|
85
|
+
loading: navState.loading,
|
|
86
|
+
title: navState.title,
|
|
87
|
+
});
|
|
88
|
+
|
|
89
|
+
// Don't process if still loading
|
|
90
|
+
if (navState.loading) {
|
|
91
|
+
return;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
// Check if this URL indicates OAuth completion
|
|
95
|
+
if (isOAuthComplete(currentUrl)) {
|
|
96
|
+
console.log('🎉 OAuth completion detected!');
|
|
97
|
+
|
|
98
|
+
// Extract the result
|
|
99
|
+
const result = extractOAuthResult(currentUrl);
|
|
100
|
+
|
|
101
|
+
if (result.success) {
|
|
102
|
+
console.log('✅ OAuth completed successfully:', result);
|
|
103
|
+
|
|
104
|
+
// Clear timeout
|
|
105
|
+
if (timeoutRef.current) {
|
|
106
|
+
clearTimeout(timeoutRef.current);
|
|
107
|
+
timeoutRef.current = null;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
// Call success callback
|
|
111
|
+
if (onSuccess && result.code) {
|
|
112
|
+
onSuccess(result.code);
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
// Close the WebView
|
|
116
|
+
if (onComplete) {
|
|
117
|
+
onComplete();
|
|
118
|
+
}
|
|
119
|
+
} else {
|
|
120
|
+
console.error('❌ OAuth failed:', result.error);
|
|
121
|
+
|
|
122
|
+
// Clear timeout
|
|
123
|
+
if (timeoutRef.current) {
|
|
124
|
+
clearTimeout(timeoutRef.current);
|
|
125
|
+
timeoutRef.current = null;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
// Set error state
|
|
129
|
+
setError('OAuth authentication failed');
|
|
130
|
+
setErrorMessage(result.error || 'Authentication failed');
|
|
131
|
+
setIsRetryable(true);
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
// Additional check for Gmail specific patterns
|
|
136
|
+
if (platform === 'email' || platform === 'gmail') {
|
|
137
|
+
const gmailPatterns = [
|
|
138
|
+
'onairos.uk/Home',
|
|
139
|
+
'onairos.uk/home',
|
|
140
|
+
'https://onairos.uk/Home',
|
|
141
|
+
'https://onairos.uk/home',
|
|
142
|
+
];
|
|
143
|
+
|
|
144
|
+
for (const pattern of gmailPatterns) {
|
|
145
|
+
if (currentUrl.includes(pattern)) {
|
|
146
|
+
console.log('✅ Gmail OAuth success detected via home page redirect');
|
|
147
|
+
|
|
148
|
+
// Clear timeout
|
|
149
|
+
if (timeoutRef.current) {
|
|
150
|
+
clearTimeout(timeoutRef.current);
|
|
151
|
+
timeoutRef.current = null;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
// Call success callback with Gmail-specific code
|
|
155
|
+
if (onSuccess) {
|
|
156
|
+
onSuccess('gmail_success');
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
// Close the WebView
|
|
160
|
+
if (onComplete) {
|
|
161
|
+
onComplete();
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
return;
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
// Check for error URLs
|
|
170
|
+
const errorPatterns = [
|
|
171
|
+
'error=',
|
|
172
|
+
'error_description=',
|
|
173
|
+
'access_denied',
|
|
174
|
+
'user_cancelled',
|
|
175
|
+
'cancelled',
|
|
176
|
+
'denied',
|
|
177
|
+
];
|
|
178
|
+
|
|
179
|
+
for (const pattern of errorPatterns) {
|
|
180
|
+
if (currentUrl.includes(pattern)) {
|
|
181
|
+
console.log('❌ OAuth error detected in URL:', pattern);
|
|
182
|
+
|
|
183
|
+
// Clear timeout
|
|
184
|
+
if (timeoutRef.current) {
|
|
185
|
+
clearTimeout(timeoutRef.current);
|
|
186
|
+
timeoutRef.current = null;
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
// Parse error details
|
|
190
|
+
try {
|
|
191
|
+
const urlObj = new URL(currentUrl);
|
|
192
|
+
const params = new URLSearchParams(urlObj.search);
|
|
193
|
+
const errorDescription = params.get('error_description') || params.get('error') || 'Authentication failed';
|
|
194
|
+
|
|
195
|
+
setError('OAuth authentication failed');
|
|
196
|
+
setErrorMessage(errorDescription);
|
|
197
|
+
setIsRetryable(true);
|
|
198
|
+
} catch (parseError) {
|
|
199
|
+
setError('OAuth authentication failed');
|
|
200
|
+
setErrorMessage('Authentication failed');
|
|
201
|
+
setIsRetryable(true);
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
return;
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
};
|
|
208
|
+
|
|
209
|
+
const handleLoadEnd = () => {
|
|
210
|
+
setIsLoading(false);
|
|
211
|
+
setError(null);
|
|
212
|
+
setErrorMessage('');
|
|
213
|
+
};
|
|
214
|
+
|
|
215
|
+
const handleError = (syntheticEvent: any) => {
|
|
216
|
+
const { nativeEvent } = syntheticEvent;
|
|
217
|
+
console.error('🚨 WebView error details:', {
|
|
218
|
+
description: nativeEvent.description,
|
|
219
|
+
code: nativeEvent.code,
|
|
220
|
+
domain: nativeEvent.domain,
|
|
221
|
+
url: nativeEvent.url,
|
|
222
|
+
canGoBack: nativeEvent.canGoBack,
|
|
223
|
+
canGoForward: nativeEvent.canGoForward,
|
|
224
|
+
loading: nativeEvent.loading,
|
|
225
|
+
target: nativeEvent.target,
|
|
226
|
+
title: nativeEvent.title,
|
|
227
|
+
});
|
|
228
|
+
|
|
229
|
+
// Check for specific NSURLErrorDomain codes
|
|
230
|
+
let errorMessage = 'Failed to load OAuth page.';
|
|
231
|
+
let isRetryable = true;
|
|
232
|
+
|
|
233
|
+
if (nativeEvent.domain === 'NSURLErrorDomain') {
|
|
234
|
+
switch (nativeEvent.code) {
|
|
235
|
+
case -1009: // NSURLErrorNotConnectedToInternet
|
|
236
|
+
errorMessage = 'No internet connection. Please check your network and try again.';
|
|
237
|
+
isRetryable = true;
|
|
238
|
+
break;
|
|
239
|
+
case -1003: // NSURLErrorCannotFindHost
|
|
240
|
+
errorMessage = 'Cannot reach authentication server. Please check your internet connection.';
|
|
241
|
+
isRetryable = true;
|
|
242
|
+
break;
|
|
243
|
+
case -1001: // NSURLErrorTimedOut
|
|
244
|
+
errorMessage = 'Connection timed out. Please try again.';
|
|
245
|
+
isRetryable = true;
|
|
246
|
+
break;
|
|
247
|
+
case -1200: // NSURLErrorSecureConnectionFailed
|
|
248
|
+
errorMessage = 'Secure connection failed. Please try again.';
|
|
249
|
+
isRetryable = true;
|
|
250
|
+
break;
|
|
251
|
+
case -1022: // NSURLErrorAppTransportSecurityRequiresSecureConnection
|
|
252
|
+
errorMessage = 'App Transport Security error. Connection must be secure.';
|
|
253
|
+
isRetryable = false;
|
|
254
|
+
break;
|
|
255
|
+
case -1004: // NSURLErrorCannotConnectToHost
|
|
256
|
+
errorMessage = 'Cannot connect to authentication server. Please try again later.';
|
|
257
|
+
isRetryable = true;
|
|
258
|
+
break;
|
|
259
|
+
case -1005: // NSURLErrorNetworkConnectionLost
|
|
260
|
+
errorMessage = 'Network connection lost. Please check your connection and try again.';
|
|
261
|
+
isRetryable = true;
|
|
262
|
+
break;
|
|
263
|
+
case -1020: // NSURLErrorDataNotAllowed
|
|
264
|
+
errorMessage = 'Data not allowed. Please check your cellular data settings.';
|
|
265
|
+
isRetryable = true;
|
|
266
|
+
break;
|
|
267
|
+
default:
|
|
268
|
+
errorMessage = `Network error (${nativeEvent.code}): ${nativeEvent.description || 'Please check your connection and try again.'}`;
|
|
269
|
+
isRetryable = true;
|
|
270
|
+
}
|
|
271
|
+
} else if (nativeEvent.domain === 'WebKitErrorDomain') {
|
|
272
|
+
switch (nativeEvent.code) {
|
|
273
|
+
case 102: // WebKitErrorFrameLoadInterruptedByPolicyChange
|
|
274
|
+
errorMessage = 'Page load was interrupted. Please try again.';
|
|
275
|
+
isRetryable = true;
|
|
276
|
+
break;
|
|
277
|
+
case 204: // WebKitErrorPlugInLoadFailed
|
|
278
|
+
errorMessage = 'Plugin failed to load. Please try again.';
|
|
279
|
+
isRetryable = true;
|
|
280
|
+
break;
|
|
281
|
+
default:
|
|
282
|
+
errorMessage = `WebKit error (${nativeEvent.code}): ${nativeEvent.description || 'Please try again.'}`;
|
|
283
|
+
isRetryable = true;
|
|
284
|
+
}
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
console.error('🔴 OAuth WebView Error:', errorMessage);
|
|
288
|
+
|
|
289
|
+
// Implement smart retry logic
|
|
290
|
+
if (isRetryable && retryCount < 3) {
|
|
291
|
+
console.log(`🔄 Auto-retrying OAuth load (attempt ${retryCount + 1}/3) in 3 seconds...`);
|
|
292
|
+
setRetryCount(prev => prev + 1);
|
|
293
|
+
setIsLoading(true);
|
|
294
|
+
setError(null);
|
|
295
|
+
|
|
296
|
+
// Retry after a delay with exponential backoff
|
|
297
|
+
const retryDelay = 3000 * Math.pow(2, retryCount); // 3s, 6s, 12s
|
|
298
|
+
setTimeout(() => {
|
|
299
|
+
if (webViewRef.current) {
|
|
300
|
+
console.log(`🔄 Attempting retry ${retryCount + 1}...`);
|
|
301
|
+
webViewRef.current.reload();
|
|
302
|
+
}
|
|
303
|
+
}, retryDelay);
|
|
304
|
+
} else {
|
|
305
|
+
setError(errorMessage);
|
|
306
|
+
setIsLoading(false);
|
|
307
|
+
|
|
308
|
+
// Show additional help for persistent errors
|
|
309
|
+
if (retryCount >= 3) {
|
|
310
|
+
console.log('❌ Maximum retries reached, showing error to user');
|
|
311
|
+
}
|
|
312
|
+
}
|
|
313
|
+
};
|
|
314
|
+
|
|
315
|
+
const handleOpenInBrowser = () => {
|
|
316
|
+
console.log('Opening OAuth URL in external browser:', url);
|
|
317
|
+
Linking.openURL(url).catch(err => {
|
|
318
|
+
console.error('Failed to open URL in browser:', err);
|
|
319
|
+
setError('Unable to open browser. Please check your device settings.');
|
|
320
|
+
});
|
|
321
|
+
};
|
|
322
|
+
|
|
323
|
+
const handleRetry = () => {
|
|
324
|
+
console.log('Manual retry requested');
|
|
325
|
+
setError(null);
|
|
326
|
+
setErrorMessage('');
|
|
327
|
+
setIsRetryable(true);
|
|
328
|
+
setIsLoading(true);
|
|
329
|
+
setRetryCount(0);
|
|
330
|
+
|
|
331
|
+
if (webViewRef.current) {
|
|
332
|
+
webViewRef.current.reload();
|
|
333
|
+
}
|
|
334
|
+
};
|
|
335
|
+
|
|
336
|
+
/**
|
|
337
|
+
* Get platform-specific icon
|
|
338
|
+
*/
|
|
339
|
+
const getPlatformIcon = (platform: string): string => {
|
|
340
|
+
switch (platform) {
|
|
341
|
+
case 'instagram':
|
|
342
|
+
return 'photo-camera';
|
|
343
|
+
case 'youtube':
|
|
344
|
+
return 'smart-display';
|
|
345
|
+
case 'pinterest':
|
|
346
|
+
return 'push-pin';
|
|
347
|
+
case 'reddit':
|
|
348
|
+
return 'forum';
|
|
349
|
+
case 'email':
|
|
350
|
+
return 'email';
|
|
351
|
+
default:
|
|
352
|
+
return 'link';
|
|
353
|
+
}
|
|
354
|
+
};
|
|
355
|
+
|
|
356
|
+
/**
|
|
357
|
+
* Get platform-specific color
|
|
358
|
+
*/
|
|
359
|
+
const getPlatformColor = (platform: string): string => {
|
|
360
|
+
switch (platform) {
|
|
361
|
+
case 'instagram':
|
|
362
|
+
return '#E1306C';
|
|
363
|
+
case 'youtube':
|
|
364
|
+
return '#FF0000';
|
|
365
|
+
case 'pinterest':
|
|
366
|
+
return '#E60023';
|
|
367
|
+
case 'reddit':
|
|
368
|
+
return '#FF4500';
|
|
369
|
+
case 'email':
|
|
370
|
+
return '#4285F4';
|
|
371
|
+
default:
|
|
372
|
+
return COLORS.primary;
|
|
373
|
+
}
|
|
374
|
+
};
|
|
375
|
+
|
|
376
|
+
// Check if URL indicates OAuth completion
|
|
377
|
+
const isOAuthComplete = (url: string): boolean => {
|
|
378
|
+
// Gmail OAuth completion patterns
|
|
379
|
+
const gmailSuccessPatterns = [
|
|
380
|
+
'https://onairos.uk/Home',
|
|
381
|
+
'https://onairos.uk/home',
|
|
382
|
+
'onairos.uk/Home',
|
|
383
|
+
'onairos.uk/home',
|
|
384
|
+
process.env.APP_HOME_URL,
|
|
385
|
+
].filter(Boolean);
|
|
386
|
+
|
|
387
|
+
// Check for success redirect patterns
|
|
388
|
+
for (const pattern of gmailSuccessPatterns) {
|
|
389
|
+
if (url.includes(pattern)) {
|
|
390
|
+
console.log('✅ OAuth success detected via redirect to:', pattern);
|
|
391
|
+
return true;
|
|
392
|
+
}
|
|
393
|
+
}
|
|
394
|
+
|
|
395
|
+
// Check for traditional OAuth callback patterns (more specific)
|
|
396
|
+
// Only match actual query parameters, not just any occurrence in the URL
|
|
397
|
+
const callbackPatterns = [
|
|
398
|
+
'code=',
|
|
399
|
+
'access_token=',
|
|
400
|
+
'oauth_token=',
|
|
401
|
+
'authorization_code=',
|
|
402
|
+
'auth_code=',
|
|
403
|
+
'token=',
|
|
404
|
+
];
|
|
405
|
+
|
|
406
|
+
for (const pattern of callbackPatterns) {
|
|
407
|
+
if (url.includes(pattern)) {
|
|
408
|
+
console.log('✅ OAuth success detected via callback parameter:', pattern);
|
|
409
|
+
return true;
|
|
410
|
+
}
|
|
411
|
+
}
|
|
412
|
+
|
|
413
|
+
// Check for specific callback URLs (more targeted than generic words)
|
|
414
|
+
const callbackUrlPatterns = [
|
|
415
|
+
'/callback',
|
|
416
|
+
'/oauth/callback',
|
|
417
|
+
'/auth/callback',
|
|
418
|
+
'redirect_uri',
|
|
419
|
+
'onairos.uk/callback',
|
|
420
|
+
'onairos.uk/oauth',
|
|
421
|
+
];
|
|
422
|
+
|
|
423
|
+
for (const pattern of callbackUrlPatterns) {
|
|
424
|
+
if (url.includes(pattern)) {
|
|
425
|
+
console.log('✅ OAuth success detected via callback URL pattern:', pattern);
|
|
426
|
+
return true;
|
|
427
|
+
}
|
|
428
|
+
}
|
|
429
|
+
|
|
430
|
+
// Check for error patterns
|
|
431
|
+
const errorPatterns = [
|
|
432
|
+
'error=',
|
|
433
|
+
'error_description=',
|
|
434
|
+
'oauth_error=',
|
|
435
|
+
'auth_error=',
|
|
436
|
+
'access_denied',
|
|
437
|
+
'user_cancelled',
|
|
438
|
+
'cancelled',
|
|
439
|
+
'denied',
|
|
440
|
+
];
|
|
441
|
+
|
|
442
|
+
for (const pattern of errorPatterns) {
|
|
443
|
+
if (url.includes(pattern)) {
|
|
444
|
+
console.log('❌ OAuth error detected via pattern:', pattern);
|
|
445
|
+
return false;
|
|
446
|
+
}
|
|
447
|
+
}
|
|
448
|
+
|
|
449
|
+
return false;
|
|
450
|
+
};
|
|
451
|
+
|
|
452
|
+
// Extract OAuth result from URL
|
|
453
|
+
const extractOAuthResult = (url: string): { success: boolean; code?: string; error?: string } => {
|
|
454
|
+
try {
|
|
455
|
+
const urlObj = new URL(url);
|
|
456
|
+
const params = new URLSearchParams(urlObj.search);
|
|
457
|
+
|
|
458
|
+
// Check for error first
|
|
459
|
+
const error = params.get('error') || params.get('error_description') || params.get('oauth_error');
|
|
460
|
+
if (error) {
|
|
461
|
+
return { success: false, error };
|
|
462
|
+
}
|
|
463
|
+
|
|
464
|
+
// Check for success indicators
|
|
465
|
+
const code = params.get('code') || params.get('authorization_code') || params.get('auth_code');
|
|
466
|
+
const accessToken = params.get('access_token') || params.get('oauth_token') || params.get('token');
|
|
467
|
+
|
|
468
|
+
if (code || accessToken) {
|
|
469
|
+
return { success: true, code: code || accessToken };
|
|
470
|
+
}
|
|
471
|
+
|
|
472
|
+
// Check for success redirect to home page (Gmail pattern)
|
|
473
|
+
const gmailSuccessPatterns = [
|
|
474
|
+
'https://onairos.uk/Home',
|
|
475
|
+
'https://onairos.uk/home',
|
|
476
|
+
'onairos.uk/Home',
|
|
477
|
+
'onairos.uk/home',
|
|
478
|
+
];
|
|
479
|
+
|
|
480
|
+
for (const pattern of gmailSuccessPatterns) {
|
|
481
|
+
if (url.includes(pattern)) {
|
|
482
|
+
console.log('✅ Gmail OAuth success detected via home page redirect');
|
|
483
|
+
return { success: true, code: 'gmail_home_redirect' };
|
|
484
|
+
}
|
|
485
|
+
}
|
|
486
|
+
|
|
487
|
+
// If we reached here and isOAuthComplete returned true, assume success
|
|
488
|
+
if (isOAuthComplete(url)) {
|
|
489
|
+
return { success: true, code: 'oauth_complete' };
|
|
490
|
+
}
|
|
491
|
+
|
|
492
|
+
return { success: false, error: 'OAuth completion not detected' };
|
|
493
|
+
} catch (error) {
|
|
494
|
+
console.error('Error parsing OAuth URL:', error);
|
|
495
|
+
return { success: false, error: 'Invalid OAuth callback URL' };
|
|
496
|
+
}
|
|
497
|
+
};
|
|
498
|
+
|
|
499
|
+
if (error) {
|
|
500
|
+
return (
|
|
501
|
+
<SafeAreaView style={styles.container}>
|
|
502
|
+
<View style={styles.header}>
|
|
503
|
+
<TouchableOpacity onPress={onClose} style={styles.closeButton}>
|
|
504
|
+
<Icon name="close" size={24} color="#000" />
|
|
505
|
+
</TouchableOpacity>
|
|
506
|
+
<View style={styles.titleContainer}>
|
|
507
|
+
<Icon
|
|
508
|
+
name={getPlatformIcon(platform)}
|
|
509
|
+
size={20}
|
|
510
|
+
color={getPlatformColor(platform)}
|
|
511
|
+
/>
|
|
512
|
+
<Text style={styles.titleText}>{platform.charAt(0).toUpperCase() + platform.slice(1)} OAuth</Text>
|
|
513
|
+
</View>
|
|
514
|
+
</View>
|
|
515
|
+
|
|
516
|
+
<View style={styles.errorContainer}>
|
|
517
|
+
<Icon name="error-outline" size={48} color="#FF6B6B" />
|
|
518
|
+
<Text style={styles.errorTitle}>Connection Error</Text>
|
|
519
|
+
<Text style={styles.errorMessage}>{errorMessage || error}</Text>
|
|
520
|
+
|
|
521
|
+
{/* Help text based on error type */}
|
|
522
|
+
{error.includes('internet') || error.includes('network') ? (
|
|
523
|
+
<View style={styles.helpContainer}>
|
|
524
|
+
<Text style={styles.helpTitle}>💡 Troubleshooting Steps:</Text>
|
|
525
|
+
<Text style={styles.helpText}>• Check your Wi-Fi or cellular connection</Text>
|
|
526
|
+
<Text style={styles.helpText}>• Try switching between Wi-Fi and cellular</Text>
|
|
527
|
+
<Text style={styles.helpText}>• Ensure you're not using a VPN that blocks OAuth</Text>
|
|
528
|
+
<Text style={styles.helpText}>• Close other apps that might be using bandwidth</Text>
|
|
529
|
+
</View>
|
|
530
|
+
) : error.includes('timeout') ? (
|
|
531
|
+
<View style={styles.helpContainer}>
|
|
532
|
+
<Text style={styles.helpTitle}>⏱️ Connection Timeout:</Text>
|
|
533
|
+
<Text style={styles.helpText}>• Your connection might be slow</Text>
|
|
534
|
+
<Text style={styles.helpText}>• Try again when you have a stronger signal</Text>
|
|
535
|
+
<Text style={styles.helpText}>• Use "Open in Browser" for better reliability</Text>
|
|
536
|
+
</View>
|
|
537
|
+
) : error.includes('secure') || error.includes('SSL') ? (
|
|
538
|
+
<View style={styles.helpContainer}>
|
|
539
|
+
<Text style={styles.helpTitle}>🔒 Security Error:</Text>
|
|
540
|
+
<Text style={styles.helpText}>• Check your device's date and time settings</Text>
|
|
541
|
+
<Text style={styles.helpText}>• Update your device's operating system</Text>
|
|
542
|
+
<Text style={styles.helpText}>• Try "Open in Browser" as an alternative</Text>
|
|
543
|
+
</View>
|
|
544
|
+
) : (
|
|
545
|
+
<View style={styles.helpContainer}>
|
|
546
|
+
<Text style={styles.helpTitle}>🔧 General Solutions:</Text>
|
|
547
|
+
<Text style={styles.helpText}>• Close and reopen the app</Text>
|
|
548
|
+
<Text style={styles.helpText}>• Check your internet connection</Text>
|
|
549
|
+
<Text style={styles.helpText}>• Use "Open in Browser" for better reliability</Text>
|
|
550
|
+
</View>
|
|
551
|
+
)}
|
|
552
|
+
|
|
553
|
+
<View style={styles.buttonContainer}>
|
|
554
|
+
{isRetryable && (
|
|
555
|
+
<TouchableOpacity style={styles.retryButton} onPress={handleRetry}>
|
|
556
|
+
<Icon name="refresh" size={20} color="#fff" style={styles.buttonIcon} />
|
|
557
|
+
<Text style={styles.retryButtonText}>Retry</Text>
|
|
558
|
+
</TouchableOpacity>
|
|
559
|
+
)}
|
|
560
|
+
<TouchableOpacity style={styles.browserButton} onPress={handleOpenInBrowser}>
|
|
561
|
+
<Icon name="open-in-browser" size={20} color="#666" style={styles.buttonIcon} />
|
|
562
|
+
<Text style={styles.browserButtonText}>Open in Browser</Text>
|
|
563
|
+
</TouchableOpacity>
|
|
564
|
+
</View>
|
|
565
|
+
|
|
566
|
+
{retryCount >= 3 && (
|
|
567
|
+
<View style={styles.persistentErrorContainer}>
|
|
568
|
+
<Text style={styles.persistentErrorText}>
|
|
569
|
+
Still having trouble? Try these steps:
|
|
570
|
+
</Text>
|
|
571
|
+
<Text style={styles.persistentErrorStep}>
|
|
572
|
+
1. Use "Open in Browser" for more reliable authentication
|
|
573
|
+
</Text>
|
|
574
|
+
<Text style={styles.persistentErrorStep}>
|
|
575
|
+
2. Check if other apps can access the internet
|
|
576
|
+
</Text>
|
|
577
|
+
<Text style={styles.persistentErrorStep}>
|
|
578
|
+
3. Restart your device if the problem persists
|
|
579
|
+
</Text>
|
|
580
|
+
</View>
|
|
581
|
+
)}
|
|
582
|
+
</View>
|
|
583
|
+
</SafeAreaView>
|
|
584
|
+
);
|
|
585
|
+
}
|
|
586
|
+
|
|
587
|
+
return (
|
|
588
|
+
<SafeAreaView style={styles.container}>
|
|
589
|
+
<View style={styles.header}>
|
|
590
|
+
<TouchableOpacity onPress={onClose} style={styles.closeButton}>
|
|
591
|
+
<Icon name="close" size={24} color="#000" />
|
|
592
|
+
</TouchableOpacity>
|
|
593
|
+
<View style={styles.titleContainer}>
|
|
594
|
+
<Icon
|
|
595
|
+
name={getPlatformIcon(platform)}
|
|
596
|
+
size={20}
|
|
597
|
+
color={getPlatformColor(platform)}
|
|
598
|
+
/>
|
|
599
|
+
<Text style={styles.titleText}>{platform.charAt(0).toUpperCase() + platform.slice(1)} OAuth</Text>
|
|
600
|
+
</View>
|
|
601
|
+
<TouchableOpacity onPress={handleOpenInBrowser} style={styles.browserButton}>
|
|
602
|
+
<Icon name="open-in-browser" size={20} color="#666" />
|
|
603
|
+
</TouchableOpacity>
|
|
604
|
+
</View>
|
|
605
|
+
|
|
606
|
+
<WebView
|
|
607
|
+
ref={webViewRef}
|
|
608
|
+
source={{ uri: url }}
|
|
609
|
+
onNavigationStateChange={onNavigationStateChange}
|
|
610
|
+
onLoadEnd={handleLoadEnd}
|
|
611
|
+
onError={handleError}
|
|
612
|
+
onHttpError={(syntheticEvent) => {
|
|
613
|
+
const { nativeEvent } = syntheticEvent;
|
|
614
|
+
console.error('WebView HTTP error:', nativeEvent);
|
|
615
|
+
setError('Failed to load OAuth page. Please check your internet connection.');
|
|
616
|
+
setIsLoading(false);
|
|
617
|
+
}}
|
|
618
|
+
style={styles.webView}
|
|
619
|
+
javaScriptEnabled={true}
|
|
620
|
+
domStorageEnabled={true}
|
|
621
|
+
startInLoadingState={true}
|
|
622
|
+
scalesPageToFit={true}
|
|
623
|
+
allowsInlineMediaPlayback={true}
|
|
624
|
+
mediaPlaybackRequiresUserAction={false}
|
|
625
|
+
mixedContentMode="compatibility"
|
|
626
|
+
thirdPartyCookiesEnabled={true}
|
|
627
|
+
sharedCookiesEnabled={true}
|
|
628
|
+
cacheEnabled={true}
|
|
629
|
+
allowsBackForwardNavigationGestures={true}
|
|
630
|
+
allowsLinkPreview={false}
|
|
631
|
+
userAgent="Mozilla/5.0 (iPhone; CPU iPhone OS 16_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.0 Mobile/15E148 Safari/604.1"
|
|
632
|
+
onShouldStartLoadWithRequest={(request) => {
|
|
633
|
+
console.log('WebView attempting to load:', request.url);
|
|
634
|
+
|
|
635
|
+
// Block about:srcdoc and other problematic URLs
|
|
636
|
+
if (request.url.startsWith('about:') ||
|
|
637
|
+
request.url.startsWith('data:') ||
|
|
638
|
+
request.url === 'about:blank') {
|
|
639
|
+
console.log('Blocking problematic URL:', request.url);
|
|
640
|
+
return false;
|
|
641
|
+
}
|
|
642
|
+
|
|
643
|
+
// Allow all other requests
|
|
644
|
+
return true;
|
|
645
|
+
}}
|
|
646
|
+
onLoadStart={(syntheticEvent) => {
|
|
647
|
+
const { nativeEvent } = syntheticEvent;
|
|
648
|
+
console.log('WebView load started:', nativeEvent.url);
|
|
649
|
+
setIsLoading(true);
|
|
650
|
+
}}
|
|
651
|
+
onLoadProgress={(syntheticEvent) => {
|
|
652
|
+
const { nativeEvent } = syntheticEvent;
|
|
653
|
+
console.log('WebView load progress:', nativeEvent.progress);
|
|
654
|
+
}}
|
|
655
|
+
renderError={(errorName) => (
|
|
656
|
+
<View style={styles.errorContainer}>
|
|
657
|
+
<Icon name="error-outline" size={48} color="#FF6B6B" />
|
|
658
|
+
<Text style={styles.errorTitle}>WebView Error</Text>
|
|
659
|
+
<Text style={styles.errorMessage}>
|
|
660
|
+
Failed to load the authentication page. Error: {errorName}
|
|
661
|
+
</Text>
|
|
662
|
+
<TouchableOpacity style={styles.retryButton} onPress={handleRetry}>
|
|
663
|
+
<Text style={styles.retryButtonText}>Retry</Text>
|
|
664
|
+
</TouchableOpacity>
|
|
665
|
+
</View>
|
|
666
|
+
)}
|
|
667
|
+
renderLoading={() => (
|
|
668
|
+
<View style={styles.loadingContainer}>
|
|
669
|
+
<ActivityIndicator size="large" color={COLORS.primary} />
|
|
670
|
+
<Text style={styles.loadingText}>Loading {platform}...</Text>
|
|
671
|
+
</View>
|
|
672
|
+
)}
|
|
673
|
+
injectedJavaScript={`
|
|
674
|
+
// Prevent white screen issues
|
|
675
|
+
window.addEventListener('error', function(e) {
|
|
676
|
+
console.log('JavaScript error:', e.message);
|
|
677
|
+
});
|
|
678
|
+
|
|
679
|
+
// Handle OAuth redirects
|
|
680
|
+
window.addEventListener('beforeunload', function(e) {
|
|
681
|
+
console.log('Page unloading:', window.location.href);
|
|
682
|
+
});
|
|
683
|
+
|
|
684
|
+
// Monitor for OAuth completion
|
|
685
|
+
setInterval(function() {
|
|
686
|
+
if (window.location.href.includes('code=') ||
|
|
687
|
+
window.location.href.includes('access_token=') ||
|
|
688
|
+
window.location.href.includes('oauth_token=') ||
|
|
689
|
+
window.location.href.includes('api2.onairos.uk')) {
|
|
690
|
+
console.log('OAuth completion detected:', window.location.href);
|
|
691
|
+
}
|
|
692
|
+
}, 1000);
|
|
693
|
+
|
|
694
|
+
true; // Required for injected JavaScript
|
|
695
|
+
`}
|
|
696
|
+
/>
|
|
697
|
+
</SafeAreaView>
|
|
698
|
+
);
|
|
699
|
+
};
|
|
700
|
+
|
|
701
|
+
const styles = StyleSheet.create({
|
|
702
|
+
container: {
|
|
703
|
+
flex: 1,
|
|
704
|
+
backgroundColor: '#fff',
|
|
705
|
+
},
|
|
706
|
+
header: {
|
|
707
|
+
flexDirection: 'row',
|
|
708
|
+
alignItems: 'center',
|
|
709
|
+
height: 56,
|
|
710
|
+
backgroundColor: '#f8f8f8',
|
|
711
|
+
borderBottomWidth: 1,
|
|
712
|
+
borderBottomColor: '#e0e0e0',
|
|
713
|
+
paddingHorizontal: 16,
|
|
714
|
+
},
|
|
715
|
+
titleContainer: {
|
|
716
|
+
flex: 1,
|
|
717
|
+
flexDirection: 'row',
|
|
718
|
+
alignItems: 'center',
|
|
719
|
+
justifyContent: 'center',
|
|
720
|
+
},
|
|
721
|
+
titleText: {
|
|
722
|
+
marginLeft: 8,
|
|
723
|
+
fontSize: 16,
|
|
724
|
+
fontWeight: '500',
|
|
725
|
+
color: '#000',
|
|
726
|
+
},
|
|
727
|
+
closeButton: {
|
|
728
|
+
padding: 8,
|
|
729
|
+
position: 'absolute',
|
|
730
|
+
left: 16,
|
|
731
|
+
zIndex: 10,
|
|
732
|
+
},
|
|
733
|
+
browserButton: {
|
|
734
|
+
backgroundColor: 'transparent',
|
|
735
|
+
borderWidth: 1,
|
|
736
|
+
borderColor: '#666',
|
|
737
|
+
paddingHorizontal: 24,
|
|
738
|
+
paddingVertical: 12,
|
|
739
|
+
borderRadius: 8,
|
|
740
|
+
flexDirection: 'row',
|
|
741
|
+
alignItems: 'center',
|
|
742
|
+
justifyContent: 'center',
|
|
743
|
+
},
|
|
744
|
+
webView: {
|
|
745
|
+
flex: 1,
|
|
746
|
+
},
|
|
747
|
+
loadingContainer: {
|
|
748
|
+
...StyleSheet.absoluteFillObject,
|
|
749
|
+
backgroundColor: 'rgba(255, 255, 255, 0.8)',
|
|
750
|
+
alignItems: 'center',
|
|
751
|
+
justifyContent: 'center',
|
|
752
|
+
},
|
|
753
|
+
loadingText: {
|
|
754
|
+
marginTop: 10,
|
|
755
|
+
fontSize: 16,
|
|
756
|
+
color: '#666',
|
|
757
|
+
},
|
|
758
|
+
errorContainer: {
|
|
759
|
+
flex: 1,
|
|
760
|
+
alignItems: 'center',
|
|
761
|
+
justifyContent: 'center',
|
|
762
|
+
padding: 20,
|
|
763
|
+
},
|
|
764
|
+
errorTitle: {
|
|
765
|
+
fontSize: 18,
|
|
766
|
+
fontWeight: '600',
|
|
767
|
+
color: '#333',
|
|
768
|
+
marginTop: 16,
|
|
769
|
+
marginBottom: 8,
|
|
770
|
+
},
|
|
771
|
+
errorMessage: {
|
|
772
|
+
fontSize: 14,
|
|
773
|
+
color: '#666',
|
|
774
|
+
textAlign: 'center',
|
|
775
|
+
marginBottom: 20,
|
|
776
|
+
},
|
|
777
|
+
retryButton: {
|
|
778
|
+
backgroundColor: COLORS.primary,
|
|
779
|
+
paddingHorizontal: 24,
|
|
780
|
+
paddingVertical: 12,
|
|
781
|
+
borderRadius: 8,
|
|
782
|
+
marginRight: 10,
|
|
783
|
+
flexDirection: 'row',
|
|
784
|
+
alignItems: 'center',
|
|
785
|
+
justifyContent: 'center',
|
|
786
|
+
},
|
|
787
|
+
retryButtonText: {
|
|
788
|
+
color: '#fff',
|
|
789
|
+
fontSize: 16,
|
|
790
|
+
fontWeight: '600',
|
|
791
|
+
},
|
|
792
|
+
buttonContainer: {
|
|
793
|
+
flexDirection: 'row',
|
|
794
|
+
justifyContent: 'center',
|
|
795
|
+
alignItems: 'center',
|
|
796
|
+
marginTop: 10,
|
|
797
|
+
},
|
|
798
|
+
browserButtonText: {
|
|
799
|
+
color: '#666',
|
|
800
|
+
fontSize: 16,
|
|
801
|
+
fontWeight: '600',
|
|
802
|
+
},
|
|
803
|
+
helpContainer: {
|
|
804
|
+
marginBottom: 20,
|
|
805
|
+
},
|
|
806
|
+
helpTitle: {
|
|
807
|
+
fontSize: 18,
|
|
808
|
+
fontWeight: '600',
|
|
809
|
+
color: '#333',
|
|
810
|
+
marginBottom: 8,
|
|
811
|
+
},
|
|
812
|
+
helpText: {
|
|
813
|
+
fontSize: 14,
|
|
814
|
+
color: '#666',
|
|
815
|
+
textAlign: 'center',
|
|
816
|
+
},
|
|
817
|
+
buttonIcon: {
|
|
818
|
+
marginRight: 10,
|
|
819
|
+
},
|
|
820
|
+
persistentErrorContainer: {
|
|
821
|
+
marginTop: 20,
|
|
822
|
+
padding: 20,
|
|
823
|
+
backgroundColor: '#f8f8f8',
|
|
824
|
+
borderRadius: 8,
|
|
825
|
+
},
|
|
826
|
+
persistentErrorText: {
|
|
827
|
+
fontSize: 16,
|
|
828
|
+
fontWeight: '600',
|
|
829
|
+
color: '#333',
|
|
830
|
+
marginBottom: 10,
|
|
831
|
+
},
|
|
832
|
+
persistentErrorStep: {
|
|
833
|
+
fontSize: 14,
|
|
834
|
+
color: '#666',
|
|
835
|
+
textAlign: 'center',
|
|
836
|
+
marginBottom: 5,
|
|
837
|
+
},
|
|
838
|
+
});
|