diff --git a/ios/Internxt.xcodeproj/project.pbxproj b/ios/Internxt.xcodeproj/project.pbxproj index 8ae710daa..856c91a7d 100644 --- a/ios/Internxt.xcodeproj/project.pbxproj +++ b/ios/Internxt.xcodeproj/project.pbxproj @@ -12,11 +12,11 @@ 18D7DE9587FA2B2314575ED6 /* ExpoModulesProvider.swift in Sources */ = {isa = PBXBuildFile; fileRef = A4921399A370F5CE6EE7EA0F /* ExpoModulesProvider.swift */; }; 2F8E878CDCAC7D5C07B5C670 /* PrivacyInfo.xcprivacy in Resources */ = {isa = PBXBuildFile; fileRef = 37A2C3A4643426D3F429F041 /* PrivacyInfo.xcprivacy */; }; 3E461D99554A48A4959DE609 /* SplashScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = AA286B85B6C04FC6940260E9 /* SplashScreen.storyboard */; }; - 445CF10172E78673CCFF0312 /* libPods-Internxt.a in Frameworks */ = {isa = PBXBuildFile; fileRef = E8FCEED6147A3BDEEFC2F889 /* libPods-Internxt.a */; }; + 4FFFBDC8299594E12C9AE469 /* libPods-Internxt.a in Frameworks */ = {isa = PBXBuildFile; fileRef = AA07C0C47C6FDDEDFF5E1E69 /* libPods-Internxt.a */; }; 7D373856C83A43879BFBE604 /* InternxtShareExtension.appex in Copy Files */ = {isa = PBXBuildFile; fileRef = 7F5486528A7D46DD91A7910F /* InternxtShareExtension.appex */; }; - 8EC5428D5ED319D4985C4204 /* libPods-InternxtShareExtension.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 0129DECF5F4E7E8C3926EC9C /* libPods-InternxtShareExtension.a */; }; 8F8148045BC14A539BD1917D /* ShareExtensionViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3A6F72E1B98D469883DAFB30 /* ShareExtensionViewController.swift */; }; BB2F792D24A3F905000567C9 /* Expo.plist in Resources */ = {isa = PBXBuildFile; fileRef = BB2F792C24A3F905000567C9 /* Expo.plist */; }; + CC023A92126B8B460E0F68AA /* libPods-InternxtShareExtension.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 38F229C01EDA05D26EC4399D /* libPods-InternxtShareExtension.a */; }; F11748422D0307B40044C1D9 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = F11748412D0307B40044C1D9 /* AppDelegate.swift */; }; /* End PBXBuildFile section */ @@ -55,27 +55,27 @@ /* End PBXCopyFilesBuildPhase section */ /* Begin PBXFileReference section */ - 0129DECF5F4E7E8C3926EC9C /* libPods-InternxtShareExtension.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-InternxtShareExtension.a"; sourceTree = BUILT_PRODUCTS_DIR; }; 13B07F961A680F5B00A75B9A /* Internxt.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Internxt.app; sourceTree = BUILT_PRODUCTS_DIR; }; 13B07FB51A68108700A75B9A /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Images.xcassets; path = Internxt/Images.xcassets; sourceTree = ""; }; 13B07FB61A68108700A75B9A /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = Info.plist; path = Internxt/Info.plist; sourceTree = ""; }; 30C3C55FF8AE435F8A82A9BC /* InternxtShareExtension.entitlements */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = undefined; includeInIndex = 0; lastKnownFileType = unknown; name = InternxtShareExtension.entitlements; path = InternxtShareExtension.entitlements; sourceTree = ""; }; 37A2C3A4643426D3F429F041 /* PrivacyInfo.xcprivacy */ = {isa = PBXFileReference; includeInIndex = 1; name = PrivacyInfo.xcprivacy; path = Internxt/PrivacyInfo.xcprivacy; sourceTree = ""; }; + 38F229C01EDA05D26EC4399D /* libPods-InternxtShareExtension.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-InternxtShareExtension.a"; sourceTree = BUILT_PRODUCTS_DIR; }; 3A6F72E1B98D469883DAFB30 /* ShareExtensionViewController.swift */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 4; includeInIndex = 0; lastKnownFileType = sourcecode.swift; name = ShareExtensionViewController.swift; path = ShareExtensionViewController.swift; sourceTree = ""; }; - 686983F82AE2AD08377BBDA6 /* Pods-Internxt.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Internxt.release.xcconfig"; path = "Target Support Files/Pods-Internxt/Pods-Internxt.release.xcconfig"; sourceTree = ""; }; + 448D004B6956EF6DF255E564 /* Pods-InternxtShareExtension.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-InternxtShareExtension.debug.xcconfig"; path = "Target Support Files/Pods-InternxtShareExtension/Pods-InternxtShareExtension.debug.xcconfig"; sourceTree = ""; }; + 7AC7F0FAF8C129DA689FC3CA /* Pods-InternxtShareExtension.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-InternxtShareExtension.release.xcconfig"; path = "Target Support Files/Pods-InternxtShareExtension/Pods-InternxtShareExtension.release.xcconfig"; sourceTree = ""; }; 7F5486528A7D46DD91A7910F /* InternxtShareExtension.appex */ = {isa = PBXFileReference; explicitFileType = "wrapper.app-extension"; fileEncoding = undefined; includeInIndex = 0; lastKnownFileType = undefined; name = InternxtShareExtension.appex; path = InternxtShareExtension.appex; sourceTree = BUILT_PRODUCTS_DIR; }; - A0AD434BC480DF8FEC95AFA9 /* Pods-InternxtShareExtension.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-InternxtShareExtension.release.xcconfig"; path = "Target Support Files/Pods-InternxtShareExtension/Pods-InternxtShareExtension.release.xcconfig"; sourceTree = ""; }; + 8F629BFFA115808F74111A4F /* Pods-Internxt.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Internxt.debug.xcconfig"; path = "Target Support Files/Pods-Internxt/Pods-Internxt.debug.xcconfig"; sourceTree = ""; }; A4921399A370F5CE6EE7EA0F /* ExpoModulesProvider.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ExpoModulesProvider.swift; path = "Pods/Target Support Files/Pods-InternxtShareExtension/ExpoModulesProvider.swift"; sourceTree = ""; }; + AA07C0C47C6FDDEDFF5E1E69 /* libPods-Internxt.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-Internxt.a"; sourceTree = BUILT_PRODUCTS_DIR; }; AA286B85B6C04FC6940260E9 /* SplashScreen.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; name = SplashScreen.storyboard; path = Internxt/SplashScreen.storyboard; sourceTree = ""; }; BB2F792C24A3F905000567C9 /* Expo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Expo.plist; sourceTree = ""; }; BD55E1E535AECF7719BDD772 /* ExpoModulesProvider.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ExpoModulesProvider.swift; path = "Pods/Target Support Files/Pods-Internxt/ExpoModulesProvider.swift"; sourceTree = ""; }; - C37D5D841BEB188E7E6D9C18 /* Pods-InternxtShareExtension.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-InternxtShareExtension.debug.xcconfig"; path = "Target Support Files/Pods-InternxtShareExtension/Pods-InternxtShareExtension.debug.xcconfig"; sourceTree = ""; }; + C28F21CC2769C0983348FCFB /* Pods-Internxt.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Internxt.release.xcconfig"; path = "Target Support Files/Pods-Internxt/Pods-Internxt.release.xcconfig"; sourceTree = ""; }; DAE15E8DB4DF4E048E04B0E0 /* Info.plist */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 4; includeInIndex = 0; lastKnownFileType = text.plist.xml; name = Info.plist; path = Info.plist; sourceTree = ""; }; - E8FCEED6147A3BDEEFC2F889 /* libPods-Internxt.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-Internxt.a"; sourceTree = BUILT_PRODUCTS_DIR; }; ED297162215061F000B7C4FE /* JavaScriptCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = JavaScriptCore.framework; path = System/Library/Frameworks/JavaScriptCore.framework; sourceTree = SDKROOT; }; F11748412D0307B40044C1D9 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = AppDelegate.swift; path = Internxt/AppDelegate.swift; sourceTree = ""; }; F11748442D0722820044C1D9 /* Internxt-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = "Internxt-Bridging-Header.h"; path = "Internxt/Internxt-Bridging-Header.h"; sourceTree = ""; }; - F4FC1400B5D5C3EC32D079C4 /* Pods-Internxt.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Internxt.debug.xcconfig"; path = "Target Support Files/Pods-Internxt/Pods-Internxt.debug.xcconfig"; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -83,7 +83,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 445CF10172E78673CCFF0312 /* libPods-Internxt.a in Frameworks */, + 4FFFBDC8299594E12C9AE469 /* libPods-Internxt.a in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -91,7 +91,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 8EC5428D5ED319D4985C4204 /* libPods-InternxtShareExtension.a in Frameworks */, + CC023A92126B8B460E0F68AA /* libPods-InternxtShareExtension.a in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -116,12 +116,24 @@ isa = PBXGroup; children = ( ED297162215061F000B7C4FE /* JavaScriptCore.framework */, - E8FCEED6147A3BDEEFC2F889 /* libPods-Internxt.a */, - 0129DECF5F4E7E8C3926EC9C /* libPods-InternxtShareExtension.a */, + AA07C0C47C6FDDEDFF5E1E69 /* libPods-Internxt.a */, + 38F229C01EDA05D26EC4399D /* libPods-InternxtShareExtension.a */, ); name = Frameworks; sourceTree = ""; }; + 518CD2953D5B93BBEC3EFA2A /* Pods */ = { + isa = PBXGroup; + children = ( + 8F629BFFA115808F74111A4F /* Pods-Internxt.debug.xcconfig */, + C28F21CC2769C0983348FCFB /* Pods-Internxt.release.xcconfig */, + 448D004B6956EF6DF255E564 /* Pods-InternxtShareExtension.debug.xcconfig */, + 7AC7F0FAF8C129DA689FC3CA /* Pods-InternxtShareExtension.release.xcconfig */, + ); + name = Pods; + path = Pods; + sourceTree = ""; + }; 66D7C2F92A0F743DEF1629DD /* Internxt */ = { isa = PBXGroup; children = ( @@ -156,8 +168,8 @@ 83CBBA001A601CBA00E9B192 /* Products */, 2D16E6871FA4F8E400B85C8A /* Frameworks */, 7151A997BCA04521BD294E7B /* InternxtShareExtension */, - BD18EB9A04B7A28951596421 /* Pods */, 981C3C7C8D79D31A9C51A14C /* ExpoModulesProviders */, + 518CD2953D5B93BBEC3EFA2A /* Pods */, ); indentWidth = 2; sourceTree = ""; @@ -191,18 +203,6 @@ path = Internxt/Supporting; sourceTree = ""; }; - BD18EB9A04B7A28951596421 /* Pods */ = { - isa = PBXGroup; - children = ( - F4FC1400B5D5C3EC32D079C4 /* Pods-Internxt.debug.xcconfig */, - 686983F82AE2AD08377BBDA6 /* Pods-Internxt.release.xcconfig */, - C37D5D841BEB188E7E6D9C18 /* Pods-InternxtShareExtension.debug.xcconfig */, - A0AD434BC480DF8FEC95AFA9 /* Pods-InternxtShareExtension.release.xcconfig */, - ); - name = Pods; - path = Pods; - sourceTree = ""; - }; C6094B16F36D353836405054 /* InternxtShareExtension */ = { isa = PBXGroup; children = ( @@ -218,16 +218,16 @@ isa = PBXNativeTarget; buildConfigurationList = 13B07F931A680F5B00A75B9A /* Build configuration list for PBXNativeTarget "Internxt" */; buildPhases = ( - 08A4A3CD28434E44B6B9DE2E /* [CP] Check Pods Manifest.lock */, + E77A4740B9DE53E096CF647C /* [CP] Check Pods Manifest.lock */, C23BF8EF9D9B379F6EADAAE0 /* [Expo] Configure project */, 13B07F871A680F5B00A75B9A /* Sources */, 13B07F8C1A680F5B00A75B9A /* Frameworks */, 13B07F8E1A680F5B00A75B9A /* Resources */, 00DD1BFF1BD5951E006B06BC /* Bundle React Native code and images */, - 800E24972A6A228C8D4807E9 /* [CP] Copy Pods Resources */, DDE0311FCC774124B044B69C /* Embed Foundation Extensions */, EF531C08E8F54B18956A8C0E /* Copy Files */, - 6948BE485C2D29A7EA9C13D4 /* [CP] Embed Pods Frameworks */, + 85D8F38E258D169326112B23 /* [CP] Embed Pods Frameworks */, + 67507A37DDFA9E8E13617EDE /* [CP] Copy Pods Resources */, ); buildRules = ( ); @@ -243,14 +243,14 @@ isa = PBXNativeTarget; buildConfigurationList = DDB0A9F040BE45D9929C1B2D /* Build configuration list for PBXNativeTarget "InternxtShareExtension" */; buildPhases = ( - 7FB323B6FD1A8F6C37ED79F4 /* [CP] Check Pods Manifest.lock */, + EEEB4CE5A47BD6587C51E4D4 /* [CP] Check Pods Manifest.lock */, 90134DAC718F4FE0B3AB7B91 /* Start Packager */, BEAE0DA94817B237B864F997 /* [Expo] Configure project */, 3495BDAE4F75461EBD6FFF8F /* Sources */, 3ABC9B4F4B9D448B9797EBD7 /* Frameworks */, 2F5766E756C84914803E7082 /* Resources */, AA9E71431FBB401A8272B8C4 /* Bundle React Native code and images */, - 6732354D6D08504E68F826A1 /* [CP] Copy Pods Resources */, + 24ECF3C7CD06EEB7F3FDB218 /* [CP] Copy Pods Resources */, ); buildRules = ( ); @@ -339,29 +339,7 @@ shellPath = /bin/sh; shellScript = "if [[ -f \"$PODS_ROOT/../.xcode.env\" ]]; then\n source \"$PODS_ROOT/../.xcode.env\"\nfi\nif [[ -f \"$PODS_ROOT/../.xcode.env.local\" ]]; then\n source \"$PODS_ROOT/../.xcode.env.local\"\nfi\n\n# The project root by default is one level up from the ios directory\nexport PROJECT_ROOT=\"$PROJECT_DIR\"/..\n\nif [[ \"$CONFIGURATION\" = *Debug* ]]; then\n export SKIP_BUNDLING=1\nfi\nif [[ -z \"$ENTRY_FILE\" ]]; then\n # Set the entry JS file using the bundler's entry resolution.\n export ENTRY_FILE=\"$(\"$NODE_BINARY\" -e \"require('expo/scripts/resolveAppEntry')\" \"$PROJECT_ROOT\" ios absolute | tail -n 1)\"\nfi\n\nif [[ -z \"$CLI_PATH\" ]]; then\n # Use Expo CLI\n export CLI_PATH=\"$(\"$NODE_BINARY\" --print \"require.resolve('@expo/cli', { paths: [require.resolve('expo/package.json')] })\")\"\nfi\nif [[ -z \"$BUNDLE_COMMAND\" ]]; then\n # Default Expo CLI command for bundling\n export BUNDLE_COMMAND=\"export:embed\"\nfi\n\n# Source .xcode.env.updates if it exists to allow\n# SKIP_BUNDLING to be unset if needed\nif [[ -f \"$PODS_ROOT/../.xcode.env.updates\" ]]; then\n source \"$PODS_ROOT/../.xcode.env.updates\"\nfi\n# Source local changes to allow overrides\n# if needed\nif [[ -f \"$PODS_ROOT/../.xcode.env.local\" ]]; then\n source \"$PODS_ROOT/../.xcode.env.local\"\nfi\n\n`\"$NODE_BINARY\" --print \"require('path').dirname(require.resolve('react-native/package.json')) + '/scripts/react-native-xcode.sh'\"`\n\n"; }; - 08A4A3CD28434E44B6B9DE2E /* [CP] Check Pods Manifest.lock */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputFileListPaths = ( - ); - inputPaths = ( - "${PODS_PODFILE_DIR_PATH}/Podfile.lock", - "${PODS_ROOT}/Manifest.lock", - ); - name = "[CP] Check Pods Manifest.lock"; - outputFileListPaths = ( - ); - outputPaths = ( - "$(DERIVED_FILE_DIR)/Pods-Internxt-checkManifestLockResult.txt", - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; - showEnvVarsInLog = 0; - }; - 6732354D6D08504E68F826A1 /* [CP] Copy Pods Resources */ = { + 24ECF3C7CD06EEB7F3FDB218 /* [CP] Copy Pods Resources */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( @@ -403,51 +381,7 @@ shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-InternxtShareExtension/Pods-InternxtShareExtension-resources.sh\"\n"; showEnvVarsInLog = 0; }; - 6948BE485C2D29A7EA9C13D4 /* [CP] Embed Pods Frameworks */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-Internxt/Pods-Internxt-frameworks.sh", - "${PODS_XCFRAMEWORKS_BUILD_DIR}/React-Core-prebuilt/React.framework/React", - "${PODS_XCFRAMEWORKS_BUILD_DIR}/ReactNativeDependencies/ReactNativeDependencies.framework/ReactNativeDependencies", - "${PODS_XCFRAMEWORKS_BUILD_DIR}/hermes-engine/Pre-built/hermes.framework/hermes", - ); - name = "[CP] Embed Pods Frameworks"; - outputPaths = ( - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/React.framework", - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/ReactNativeDependencies.framework", - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/hermes.framework", - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Internxt/Pods-Internxt-frameworks.sh\"\n"; - showEnvVarsInLog = 0; - }; - 7FB323B6FD1A8F6C37ED79F4 /* [CP] Check Pods Manifest.lock */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputFileListPaths = ( - ); - inputPaths = ( - "${PODS_PODFILE_DIR_PATH}/Podfile.lock", - "${PODS_ROOT}/Manifest.lock", - ); - name = "[CP] Check Pods Manifest.lock"; - outputFileListPaths = ( - ); - outputPaths = ( - "$(DERIVED_FILE_DIR)/Pods-InternxtShareExtension-checkManifestLockResult.txt", - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; - showEnvVarsInLog = 0; - }; - 800E24972A6A228C8D4807E9 /* [CP] Copy Pods Resources */ = { + 67507A37DDFA9E8E13617EDE /* [CP] Copy Pods Resources */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( @@ -493,6 +427,28 @@ shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Internxt/Pods-Internxt-resources.sh\"\n"; showEnvVarsInLog = 0; }; + 85D8F38E258D169326112B23 /* [CP] Embed Pods Frameworks */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + "${PODS_ROOT}/Target Support Files/Pods-Internxt/Pods-Internxt-frameworks.sh", + "${PODS_XCFRAMEWORKS_BUILD_DIR}/React-Core-prebuilt/React.framework/React", + "${PODS_XCFRAMEWORKS_BUILD_DIR}/ReactNativeDependencies/ReactNativeDependencies.framework/ReactNativeDependencies", + "${PODS_XCFRAMEWORKS_BUILD_DIR}/hermes-engine/Pre-built/hermes.framework/hermes", + ); + name = "[CP] Embed Pods Frameworks"; + outputPaths = ( + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/React.framework", + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/ReactNativeDependencies.framework", + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/hermes.framework", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Internxt/Pods-Internxt-frameworks.sh\"\n"; + showEnvVarsInLog = 0; + }; 90134DAC718F4FE0B3AB7B91 /* Start Packager */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; @@ -569,6 +525,50 @@ shellPath = /bin/sh; shellScript = "# This script configures Expo modules and generates the modules provider file.\nbash -l -c \"./Pods/Target\\ Support\\ Files/Pods-Internxt/expo-configure-project.sh\"\n"; }; + E77A4740B9DE53E096CF647C /* [CP] Check Pods Manifest.lock */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + ); + inputPaths = ( + "${PODS_PODFILE_DIR_PATH}/Podfile.lock", + "${PODS_ROOT}/Manifest.lock", + ); + name = "[CP] Check Pods Manifest.lock"; + outputFileListPaths = ( + ); + outputPaths = ( + "$(DERIVED_FILE_DIR)/Pods-Internxt-checkManifestLockResult.txt", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; + showEnvVarsInLog = 0; + }; + EEEB4CE5A47BD6587C51E4D4 /* [CP] Check Pods Manifest.lock */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + ); + inputPaths = ( + "${PODS_PODFILE_DIR_PATH}/Podfile.lock", + "${PODS_ROOT}/Manifest.lock", + ); + name = "[CP] Check Pods Manifest.lock"; + outputFileListPaths = ( + ); + outputPaths = ( + "$(DERIVED_FILE_DIR)/Pods-InternxtShareExtension-checkManifestLockResult.txt", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; + showEnvVarsInLog = 0; + }; /* End PBXShellScriptBuildPhase section */ /* Begin PBXSourcesBuildPhase section */ @@ -603,7 +603,7 @@ /* Begin XCBuildConfiguration section */ 00BF7E5F54544AE9B1CDE9D5 /* Debug */ = { isa = XCBuildConfiguration; - baseConfigurationReference = C37D5D841BEB188E7E6D9C18 /* Pods-InternxtShareExtension.debug.xcconfig */; + baseConfigurationReference = 448D004B6956EF6DF255E564 /* Pods-InternxtShareExtension.debug.xcconfig */; buildSettings = { CLANG_ENABLE_MODULES = YES; CODE_SIGN_ENTITLEMENTS = InternxtShareExtension/InternxtShareExtension.entitlements; @@ -632,7 +632,7 @@ }; 13B07F941A680F5B00A75B9A /* Debug */ = { isa = XCBuildConfiguration; - baseConfigurationReference = F4FC1400B5D5C3EC32D079C4 /* Pods-Internxt.debug.xcconfig */; + baseConfigurationReference = 8F629BFFA115808F74111A4F /* Pods-Internxt.debug.xcconfig */; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; @@ -671,7 +671,7 @@ }; 13B07F951A680F5B00A75B9A /* Release */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 686983F82AE2AD08377BBDA6 /* Pods-Internxt.release.xcconfig */; + baseConfigurationReference = C28F21CC2769C0983348FCFB /* Pods-Internxt.release.xcconfig */; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; @@ -822,7 +822,7 @@ }; B247FB85ACF44D11B7509F34 /* Release */ = { isa = XCBuildConfiguration; - baseConfigurationReference = A0AD434BC480DF8FEC95AFA9 /* Pods-InternxtShareExtension.release.xcconfig */; + baseConfigurationReference = 7AC7F0FAF8C129DA689FC3CA /* Pods-InternxtShareExtension.release.xcconfig */; buildSettings = { CLANG_ENABLE_MODULES = YES; CODE_SIGN_ENTITLEMENTS = InternxtShareExtension/InternxtShareExtension.entitlements; diff --git a/ios/Internxt.xcodeproj/xcshareddata/xcschemes/Internxt.xcscheme b/ios/Internxt.xcodeproj/xcshareddata/xcschemes/Internxt.xcscheme index 8858a1658..9e43b5943 100644 --- a/ios/Internxt.xcodeproj/xcshareddata/xcschemes/Internxt.xcscheme +++ b/ios/Internxt.xcodeproj/xcshareddata/xcschemes/Internxt.xcscheme @@ -41,7 +41,7 @@ = ({ viewMode }) => { +const DriveItemSkinSkeleton: React.FC<{ viewMode?: 'grid' | 'list' }> = ({ viewMode }) => { const tailwind = useTailwind(); - const [fadeAnim] = useState(new Animated.Value(1)); + const fadeAnim = useRef(new Animated.Value(1)).current; - Animated.loop( - Animated.sequence([ - Animated.timing(fadeAnim, { - toValue: 0.4, - duration: 1500, - easing: Easing.linear, - useNativeDriver: true, - }), - Animated.timing(fadeAnim, { - toValue: 1, - duration: 800, - easing: Easing.linear, - useNativeDriver: true, - }), - ]), - ).start(); + useEffect(() => { + const anim = Animated.loop( + Animated.sequence([ + Animated.timing(fadeAnim, { + toValue: 0.4, + duration: 1500, + easing: Easing.linear, + useNativeDriver: true, + }), + Animated.timing(fadeAnim, { + toValue: 1, + duration: 800, + easing: Easing.linear, + useNativeDriver: true, + }), + ]), + ); + anim.start(); + return () => anim.stop(); + }, []); - if (viewMode === DriveListViewMode.Grid) { + if (viewMode === 'grid') { const renderGridItem = () => { return ( diff --git a/src/shareExtension/ShareExtensionView.ios.tsx b/src/shareExtension/ShareExtensionView.ios.tsx index 1dbc7ed36..8216e6a69 100644 --- a/src/shareExtension/ShareExtensionView.ios.tsx +++ b/src/shareExtension/ShareExtensionView.ios.tsx @@ -39,12 +39,7 @@ const ShareExtensionView = (props: ShareExtensionProps) => { } return ( - + ); }; diff --git a/src/shareExtension/components/BottomFilePanel.tsx b/src/shareExtension/components/BottomFilePanel.tsx new file mode 100644 index 000000000..1615bbd28 --- /dev/null +++ b/src/shareExtension/components/BottomFilePanel.tsx @@ -0,0 +1,217 @@ +import { CaretLeftIcon, CaretRightIcon } from 'phosphor-react-native'; +import { useCallback, useMemo } from 'react'; +import { + Animated, + Image, + StyleSheet, + Text, + TextInput, + TouchableOpacity, + View, + useWindowDimensions, +} from 'react-native'; +import { useTailwind } from 'tailwind-rn'; +import StackedFilesIconSvg from '../../../assets/icons/stacked-files.svg'; +import strings from '../../../assets/lang/strings'; +import { getFileTypeIcon } from '../../helpers/filetypes'; +import { useBottomPanelAnimation } from '../hooks/useBottomPanelAnimation'; +import { colors, fontStyles } from '../theme'; +import { SharedFile } from '../types'; +import { formatBytes } from '../utils'; +import { TextButton } from './TextButton'; + +interface BottomFilePanelProps { + sharedFiles: SharedFile[]; + editingName: string; + isRenaming: boolean; + onStartRename: () => void; + onChangeName: (name: string) => void; + onEndRename: () => void; +} + +const getExtension = (file: SharedFile): string => { + if (file.mimeType) { + const parts = file.mimeType.split('/'); + return parts[1]?.toUpperCase() ?? ''; + } + if (file.fileName) { + const parts = file.fileName.split('.'); + return parts.length > 1 ? (parts[parts.length - 1]?.toUpperCase() ?? '') : ''; + } + return ''; +}; + +const getFormats = (files: SharedFile[]): string => { + const exts = new Set(files.map(getExtension).filter(Boolean)); + if (exts.size === 0) return ''; + if (exts.size === 1) return [...exts][0] ?? ''; + return strings.screens.ShareExtension.multipleFormats; +}; + +const TAB_WIDTH = 44; +const PANEL_MARGIN = 16; +const HANDLE_ICON_SIZE = 16; + +const StackedFilesIcon = () => ; + +export const BottomFilePanel = ({ + sharedFiles, + editingName, + isRenaming, + onStartRename, + onChangeName, + onEndRename, +}: BottomFilePanelProps) => { + const tailwind = useTailwind(); + const { width: screenWidth } = useWindowDimensions(); + const { isCollapsed, keyboardBottom, slideAnimation, toggle } = useBottomPanelAnimation(isRenaming, screenWidth); + + const formats = useMemo(() => getFormats(sharedFiles), [sharedFiles]); + const totalSize = useMemo(() => { + const sum = sharedFiles.reduce((acc, file) => (file.size != null ? acc + file.size : acc), 0); + const hasAnySize = sharedFiles.some((file) => file.size != null); + return hasAnySize ? sum : null; + }, [sharedFiles]); + + const containerStyle = useMemo(() => [tailwind('flex-row items-center'), panelStyles.container], [tailwind]); + + const file = sharedFiles[0]; + const originalFileName = file?.fileName ?? ''; + const dotIndex = originalFileName.lastIndexOf('.'); + const fileExt = dotIndex > 0 ? originalFileName.slice(dotIndex) : ''; + const nameWithoutExt = + fileExt && editingName.endsWith(fileExt) ? editingName.slice(0, editingName.length - fileExt.length) : editingName; + + const handleRenameChange = useCallback((name: string) => onChangeName(name + fileExt), [fileExt, onChangeName]); + const handleEndRename = useCallback(() => { + if (!nameWithoutExt.trim()) { + onChangeName(originalFileName || strings.screens.ShareExtension.fileNameFallback); + } + onEndRename(); + }, [nameWithoutExt, onChangeName, onEndRename, originalFileName]); + + if (sharedFiles.length === 0) return null; + + const collapseButton = ( + + {isCollapsed ? ( + + ) : ( + + )} + + ); + + const animatedStyle = { bottom: keyboardBottom, transform: [{ translateX: slideAnimation }] }; + + if (sharedFiles.length > 1) { + return ( + + {collapseButton} + + + + + {strings.formatString(strings.screens.ShareExtension.itemsSelected, sharedFiles.length)} + + {totalSize != null || formats ? ( + + {[totalSize != null ? formatBytes(totalSize) : null, formats || null].filter(Boolean).join(' · ')} + + ) : null} + + + ); + } + + if (!file) return null; + const ext = getExtension(file); + const IconComponent = getFileTypeIcon(ext.toLowerCase()); + const displayName = editingName || file.fileName || strings.screens.ShareExtension.fileNameFallback; + const isImage = file.mimeType?.startsWith('image/') ?? false; + + return ( + + {collapseButton} + + + {isImage ? ( + + ) : ( + + )} + + + {isRenaming ? ( + + ) : ( + + {displayName} + + )} + + {file.size != null ? `${formatBytes(file.size)} · ${ext}` : ext} + + + {!isRenaming && } + + ); +}; + +const panelStyles = StyleSheet.create({ + container: { + position: 'absolute', + marginHorizontal: PANEL_MARGIN, + paddingHorizontal: PANEL_MARGIN, + paddingVertical: 12, + minHeight: 64, + borderRadius: 20, + borderWidth: 1, + borderColor: colors.gray10, + backgroundColor: colors.surface, + shadowColor: '#000', + shadowOffset: { width: 0, height: 32 }, + shadowOpacity: 0.04, + shadowRadius: 40, + elevation: 8, + }, + collapseButton: { + width: TAB_WIDTH, + alignSelf: 'stretch', + }, + divider: { + width: 1, + alignSelf: 'stretch', + backgroundColor: colors.gray10, + marginRight: 12, + }, + fileImage: { + width: 36, + height: 36, + borderRadius: 6, + }, + fileNameText: { + paddingRight: 8, + }, + renameInput: { + padding: 0, + borderBottomWidth: 1, + borderBottomColor: colors.primary, + }, +}); diff --git a/src/shareExtension/components/DriveScreen/DriveList.tsx b/src/shareExtension/components/DriveScreen/DriveList.tsx index 63f7db054..47496299e 100644 --- a/src/shareExtension/components/DriveScreen/DriveList.tsx +++ b/src/shareExtension/components/DriveScreen/DriveList.tsx @@ -1,11 +1,10 @@ -import { DriveListViewMode } from '@internxt-mobile/types/drive/ui'; import { useCallback } from 'react'; import { FlatList, Keyboard, Text, View } from 'react-native'; import DriveItemSkinSkeleton from 'src/components/DriveItemSkinSkeleton'; import { useTailwind } from 'tailwind-rn'; import strings from '../../../../assets/lang/strings'; import { fontStyles } from '../../theme'; -import { ShareFileItem, ShareFolderItem } from '../../types'; +import { DriveViewMode, ShareFileItem, ShareFolderItem } from '../../types'; import { FileListItem } from '../FileListItem'; export type DriveListItem = { type: 'folder'; data: ShareFolderItem } | { type: 'file'; data: ShareFileItem }; @@ -14,7 +13,7 @@ const keyExtractor = (item: DriveListItem) => item.data.uuid; interface DriveListProps { listData: DriveListItem[]; - viewMode: DriveListViewMode; + viewMode: DriveViewMode; loading: boolean; loadingMore: boolean; searchQuery: string; @@ -32,7 +31,7 @@ export const DriveList = ({ onLoadMore, }: DriveListProps) => { const tailwind = useTailwind(); - const numColumns = viewMode === DriveListViewMode.Grid ? 3 : 1; + const numColumns = viewMode === 'grid' ? 3 : 1; const renderItem = useCallback( ({ item }: { item: DriveListItem }) => { @@ -47,7 +46,7 @@ export const DriveList = ({ return ( {Array.from({ length: 10 }).map((_, i) => ( - + ))} @@ -62,7 +61,7 @@ export const DriveList = ({ keyExtractor={keyExtractor} numColumns={numColumns} renderItem={renderItem} - contentContainerStyle={viewMode === DriveListViewMode.Grid ? tailwind('px-2') : undefined} + contentContainerStyle={viewMode === 'grid' ? tailwind('px-2') : undefined} ListEmptyComponent={ diff --git a/src/shareExtension/components/DriveScreen/SortRow.tsx b/src/shareExtension/components/DriveScreen/SortRow.tsx index 3b6f2967f..3c769f14f 100644 --- a/src/shareExtension/components/DriveScreen/SortRow.tsx +++ b/src/shareExtension/components/DriveScreen/SortRow.tsx @@ -1,12 +1,12 @@ -import { DriveListViewMode } from '@internxt-mobile/types/drive/ui'; import { RowsIcon, SquaresFourIcon } from 'phosphor-react-native'; import { Text, TouchableOpacity, View } from 'react-native'; import { useTailwind } from 'tailwind-rn'; import strings from '../../../../assets/lang/strings'; import { colors, fontStyles } from '../../theme'; +import { DriveViewMode } from '../../types'; interface SortRowProps { - viewMode: DriveListViewMode; + viewMode: DriveViewMode; onToggleViewMode: () => void; } @@ -15,16 +15,11 @@ export const SortRow = ({ viewMode, onToggleViewMode }: SortRowProps) => { return ( - + {strings.screens.ShareExtension.sortByName} - {viewMode === DriveListViewMode.List ? ( + {viewMode === 'list' ? ( ) : ( diff --git a/src/shareExtension/components/FileListItem.tsx b/src/shareExtension/components/FileListItem.tsx index 824b4f9e6..b8e04188d 100644 --- a/src/shareExtension/components/FileListItem.tsx +++ b/src/shareExtension/components/FileListItem.tsx @@ -1,15 +1,14 @@ -import { DriveListViewMode } from '@internxt-mobile/types/drive/ui'; import { StyleSheet, Text, TouchableOpacity, View } from 'react-native'; import { useTailwind } from 'tailwind-rn'; import { FolderIcon, getFileTypeIcon } from '../../helpers/filetypes'; import { colors, fontStyles } from '../theme'; -import { ShareFileItem, ShareFolderItem } from '../types'; +import { DriveViewMode, ShareFileItem, ShareFolderItem } from '../types'; import { formatBytes, formatDate } from '../utils'; interface FileListItemProps { item: ShareFolderItem | ShareFileItem; isFolder: boolean; - viewMode: DriveListViewMode; + viewMode: DriveViewMode; onPress?: () => void; } @@ -20,7 +19,7 @@ export const FileListItem = ({ item, isFolder, viewMode, onPress }: FileListItem const fileSize = fileItem ? parseInt(fileItem.size, 10) : NaN; const fileSizeText = isNaN(fileSize) ? '' : formatBytes(fileSize); - if (viewMode === DriveListViewMode.Grid) { + if (viewMode === 'grid') { return ( { + const [isCollapsed, setIsCollapsed] = useState(false); + const slideAnimation = useRef(new Animated.Value(0)).current; + const keyboardBottom = useRef(new Animated.Value(PANEL_BOTTOM)).current; + + useEffect(() => { + if (Platform.OS !== 'ios') return; + if (isRenaming) { + const tid = setTimeout(() => { + const metrics = Keyboard.metrics(); + const height = metrics?.height ?? 336; + Animated.timing(keyboardBottom, { + toValue: height + PANEL_BOTTOM, + duration: 200, + useNativeDriver: false, + }).start(); + }, 50); + return () => clearTimeout(tid); + } else { + Animated.timing(keyboardBottom, { + toValue: PANEL_BOTTOM, + duration: 200, + useNativeDriver: false, + }).start(); + } + }, [isRenaming, keyboardBottom]); + + useEffect(() => { + if (Platform.OS !== 'android') return; + const showSub = Keyboard.addListener('keyboardDidShow', (e) => { + Animated.timing(keyboardBottom, { + toValue: e.endCoordinates.height + PANEL_BOTTOM, + duration: 200, + useNativeDriver: false, + }).start(); + }); + const hideSub = Keyboard.addListener('keyboardDidHide', () => { + Animated.timing(keyboardBottom, { + toValue: PANEL_BOTTOM, + duration: 200, + useNativeDriver: false, + }).start(); + }); + return () => { + showSub.remove(); + hideSub.remove(); + }; + }, [keyboardBottom]); + + const toggle = useCallback(() => { + if (isRenaming) return; + const next = !isCollapsed; + setIsCollapsed(next); + Animated.spring(slideAnimation, { + toValue: next ? screenWidth - PANEL_MARGIN - TAB_WIDTH : 0, + useNativeDriver: false, + bounciness: 5, + speed: 14, + }).start(); + }, [isRenaming, isCollapsed, slideAnimation, screenWidth]); + + return { isCollapsed, keyboardBottom, slideAnimation, toggle }; +}; diff --git a/src/shareExtension/hooks/useFolderNavigation.ts b/src/shareExtension/hooks/useFolderNavigation.ts index cf220f090..8d214d550 100644 --- a/src/shareExtension/hooks/useFolderNavigation.ts +++ b/src/shareExtension/hooks/useFolderNavigation.ts @@ -1,7 +1,6 @@ -import { DriveListViewMode } from '@internxt-mobile/types/drive/ui'; import { useCallback, useEffect, useMemo, useRef, useState } from 'react'; import { shareDriveService } from '../services/shareDriveService'; -import { ShareFileItem, ShareFolderItem } from '../types'; +import { DriveViewMode, ShareFileItem, ShareFolderItem } from '../types'; interface FolderNavEntry { uuid: string; @@ -17,8 +16,8 @@ interface UseFolderNavigationResult { loadMore: () => void; searchQuery: string; setSearchQuery: (value: string) => void; - viewMode: DriveListViewMode; - setViewMode: (viewMode: DriveListViewMode) => void; + viewMode: DriveViewMode; + setViewMode: (viewMode: DriveViewMode) => void; breadcrumb: FolderNavEntry[]; navigate: (uuid: string, name: string) => void; goBack: () => void; @@ -36,10 +35,10 @@ export const useFolderNavigation = (rootFolderUuid: string, rootFolderName = 'Dr const [folderStack, setFolderStack] = useState([{ uuid: rootFolderUuid, name: rootFolderName }]); const [allFolders, setAllFolders] = useState([]); const [allFiles, setAllFiles] = useState([]); - const [loading, setLoading] = useState(false); + const [loading, setLoading] = useState(true); const [loadingMore, setLoadingMore] = useState(false); const [searchQuery, setSearchQuery] = useState(''); - const [viewMode, setViewMode] = useState(DriveListViewMode.List); + const [viewMode, setViewMode] = useState('list'); const folderOffsetRef = useRef(0); const fileOffsetRef = useRef(0); @@ -80,6 +79,8 @@ export const useFolderNavigation = (rootFolderUuid: string, rootFolderName = 'Dr fileOffsetRef.current = filesPage.items.length; if (!filesPage.hasMore) filesExhaustedRef.current = true; } + } catch (e) { + console.error('[ShareExtension] loadFolder error:', e); } finally { if (loadSequentialRef.current === seq) setLoading(false); } diff --git a/src/shareExtension/hooks/useShareAuth.android.ts b/src/shareExtension/hooks/useShareAuth.android.ts index 70d2a8746..5980b55de 100644 --- a/src/shareExtension/hooks/useShareAuth.android.ts +++ b/src/shareExtension/hooks/useShareAuth.android.ts @@ -1,6 +1,7 @@ import { useEffect, useState } from 'react'; import asyncStorageService from '../../services/AsyncStorageService'; import { AsyncStorageKey } from '../../types'; +import ShareSdkManager from '../services/ShareSdkManager'; export type AuthStatus = 'loading' | 'authenticated' | 'unauthenticated'; @@ -22,6 +23,9 @@ export const useShareAuth = (): ShareAuthData => { useEffect(() => { Promise.all([asyncStorageService.getItem(AsyncStorageKey.PhotosToken), asyncStorageService.getUser()]) .then(([photosToken, user]) => { + if (photosToken) { + ShareSdkManager.init({ newToken: photosToken }); + } setData({ status: photosToken ? 'authenticated' : 'unauthenticated', photosToken, diff --git a/src/shareExtension/hooks/useShareExtension.ios.ts b/src/shareExtension/hooks/useShareExtension.ios.ts index 593ec6ebb..7239546d2 100644 --- a/src/shareExtension/hooks/useShareExtension.ios.ts +++ b/src/shareExtension/hooks/useShareExtension.ios.ts @@ -1,5 +1,5 @@ import { useEffect, useMemo, useState } from 'react'; -import { SdkManager } from '../../services/common/sdk/SdkManager'; +import ShareSdkManager from '../services/ShareSdkManager'; import { SharedFile } from '../types'; import { readSize } from '../utils'; @@ -15,13 +15,18 @@ export const useShareExtension = ({ photosToken, files, images, videos }: ShareE useEffect(() => { if (!photosToken) return; - SdkManager.init({ token: photosToken, newToken: photosToken }); + ShareSdkManager.init({ newToken: photosToken }); setSdkReady(true); }, [photosToken]); const sharedFiles = useMemo( () => [ - ...(files ?? []).map((uri) => ({ uri, mimeType: null, fileName: uri.split('/').pop() ?? null, size: readSize(uri) })), + ...(files ?? []).map((uri) => ({ + uri, + mimeType: null, + fileName: uri.split('/').pop() ?? null, + size: readSize(uri), + })), ...(images ?? []).map((uri) => ({ uri, mimeType: 'image/jpeg', diff --git a/src/shareExtension/screens/DriveScreen.tsx b/src/shareExtension/screens/DriveScreen.tsx index 39abc7b18..85adad1e7 100644 --- a/src/shareExtension/screens/DriveScreen.tsx +++ b/src/shareExtension/screens/DriveScreen.tsx @@ -1,4 +1,3 @@ -import { DriveListViewMode } from '@internxt-mobile/types/drive/ui'; import { useCallback, useEffect, useMemo, useState } from 'react'; import { Animated, Keyboard, View } from 'react-native'; import { useTailwind } from 'tailwind-rn'; @@ -80,7 +79,7 @@ export const DriveScreen = ({ sharedFiles, rootFolderUuid, onClose, onSave }: Dr const handleCloseNewFolderModal = useCallback(() => setShowNewFolderModal(false), []); const handleClearSearch = useCallback(() => setSearchQuery(''), []); const handleToggleViewMode = useCallback( - () => setViewMode(viewMode === DriveListViewMode.List ? DriveListViewMode.Grid : DriveListViewMode.List), + () => setViewMode(viewMode === 'list' ? 'grid' : 'list'), [viewMode, setViewMode], ); const handleStartRename = useCallback(() => setIsRenaming(true), []); @@ -114,7 +113,6 @@ export const DriveScreen = ({ sharedFiles, rootFolderUuid, onClose, onSave }: Dr )} - { + const extra = Constants.expoConfig?.extra ?? Constants.manifest2?.extra ?? {}; + return extra as { DRIVE_NEW_API_URL: string; CLOUDFLARE_TOKEN?: string }; +}; + +const getAppDetails = () => ({ + clientName: packageJson.name, + clientVersion: packageJson.version.replace('v', ''), + desktopHeader: getEnv().CLOUDFLARE_TOKEN ?? '', +}); + +class ShareSdkManager { + private static apiSecurity?: ShareSdkManagerApiSecurity; + private static storageClient?: ReturnType; + + static init(apiSecurity: ShareSdkManagerApiSecurity) { + this.apiSecurity = apiSecurity; + this.storageClient = undefined; + } + + static get storageV2() { + if (!this.apiSecurity) throw new Error('ShareSdkManager not initialized'); + if (!this.storageClient) { + this.storageClient = Drive.Storage.client(getEnv().DRIVE_NEW_API_URL, getAppDetails(), { + token: this.apiSecurity.newToken, + }); + } + return this.storageClient; + } +} + +export default ShareSdkManager; diff --git a/src/shareExtension/services/shareDriveService.ts b/src/shareExtension/services/shareDriveService.ts index e943414bc..9c458c309 100644 --- a/src/shareExtension/services/shareDriveService.ts +++ b/src/shareExtension/services/shareDriveService.ts @@ -1,4 +1,4 @@ -import { SdkManager } from '../../services/common/sdk/SdkManager'; +import ShareSdkManager from './ShareSdkManager'; import { ShareFileItem, ShareFolderItem } from '../types'; const PAGE_SIZE = 50; @@ -27,8 +27,7 @@ const getFolderFolders = async ( folderUuid: string, offset: number, ): Promise<{ items: ShareFolderItem[]; hasMore: boolean }> => { - const sdk = SdkManager.getInstance(); - const [promise] = sdk.storageV2.getFolderFoldersByUuid(folderUuid, offset, PAGE_SIZE, 'plainName', 'ASC'); + const [promise] = ShareSdkManager.storageV2.getFolderFoldersByUuid(folderUuid, offset, PAGE_SIZE, 'plainName', 'ASC'); const result = await promise; return { items: result.folders.map(mapFolder), @@ -40,8 +39,7 @@ const getFolderFiles = async ( folderUuid: string, offset: number, ): Promise<{ items: ShareFileItem[]; hasMore: boolean }> => { - const sdk = SdkManager.getInstance(); - const [promise] = sdk.storageV2.getFolderFilesByUuid(folderUuid, offset, PAGE_SIZE, 'plainName', 'ASC'); + const [promise] = ShareSdkManager.storageV2.getFolderFilesByUuid(folderUuid, offset, PAGE_SIZE, 'plainName', 'ASC'); const result = await promise; return { items: result.files.map(mapFile), @@ -50,8 +48,7 @@ const getFolderFiles = async ( }; const createFolder = async (parentFolderUuid: string, name: string): Promise => { - const sdk = SdkManager.getInstance(); - const result = sdk.storageV2.createFolderByUuid({ parentFolderUuid, plainName: name }); + const result = ShareSdkManager.storageV2.createFolderByUuid({ parentFolderUuid, plainName: name }); if (!result) throw new Error('createFolder failed'); await result[0]; }; diff --git a/src/shareExtension/types.ts b/src/shareExtension/types.ts index 52c7c7165..73011932e 100644 --- a/src/shareExtension/types.ts +++ b/src/shareExtension/types.ts @@ -19,3 +19,5 @@ export interface ShareFileItem { updatedAt: string; } +export type DriveViewMode = 'grid' | 'list'; +