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