diff --git a/.gitignore b/.gitignore index d8fbb5d941e..abae38b7989 100644 --- a/.gitignore +++ b/.gitignore @@ -20,7 +20,6 @@ DerivedData *.hmap *.ipa *.xcuserstate -project.xcworkspace # Android/IJ # diff --git a/android/app/build.gradle b/android/app/build.gradle index 4724688c64a..97fb3927a1d 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -80,10 +80,10 @@ import com.android.build.OutputFile */ project.ext.react = [ - entryFile: "index.js", - enableHermes: false, // clean and rebuild if changing - // quasi-unstable: see commits 8f8a266af and 833d083a9 - jsBundleDirRelease: "$buildDir/intermediates/merged_assets/release/out" + entryFile : "index.js", + enableHermes : false, // clean and rebuild if changing + // quasi-unstable: see commits 8f8a266af and 833d083a9 + jsBundleDirRelease: "$buildDir/intermediates/merged_assets/release/out" ] apply from: "../../node_modules/react-native/react.gradle" @@ -122,15 +122,15 @@ def enableProguardInReleaseBuilds = false def shrinkResourcesInProguardBuilds = false /** - * The preferred build flavor of JavaScriptCore. - * - * For example, to use the international variant, you can use: - * `def jscFlavor = 'org.webkit:android-jsc-intl:+'` - * - * The international variant includes ICU i18n library and necessary data - * allowing to use e.g. `Date.toLocaleString` and `String.localeCompare` that - * give correct results when using with locales other than en-US. Note that - * this variant is about 6MiB larger per architecture than default. + * The preferred build flavor of JavaScriptCore. + * + * For example, to use the international variant, you can use: + * `def jscFlavor = 'org.webkit:android-jsc-intl:+'` + * + * The international variant includes ICU i18n library and necessary data + * allowing to use e.g. `Date.toLocaleString` and `String.localeCompare` that + * give correct results when using with locales other than en-US. Note that + * this variant is about 6MiB larger per architecture than default. */ def jscFlavor = 'org.webkit:android-jsc:+' @@ -191,7 +191,7 @@ android { release { minifyEnabled enableProguardInReleaseBuilds // `minifyEnabled` is required for `shrinkResources` - shrinkResources (enableProguardInReleaseBuilds && shrinkResourcesInProguardBuilds) + shrinkResources(enableProguardInReleaseBuilds && shrinkResourcesInProguardBuilds) proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro" if (project.hasProperty('signed')) { @@ -238,11 +238,11 @@ dependencies { implementation "com.facebook.react:react-native:+" // From node_modules if (enableHermes) { - def hermesPath = "../../node_modules/hermesvm/android/"; - debugImplementation files(hermesPath + "hermes-debug.aar") - releaseImplementation files(hermesPath + "hermes-release.aar") + def hermesPath = "../../node_modules/hermesvm/android/"; + debugImplementation files(hermesPath + "hermes-debug.aar") + releaseImplementation files(hermesPath + "hermes-release.aar") } else { - implementation jscFlavor + implementation jscFlavor } implementation 'com.facebook.fresco:animated-gif:1.10.0' // For animated GIF support diff --git a/android/app/src/main/java/com/zulipmobile/MainActivity.java b/android/app/src/main/java/com/zulipmobile/MainActivity.java index 3d7e9cb61f4..a4302a2889e 100644 --- a/android/app/src/main/java/com/zulipmobile/MainActivity.java +++ b/android/app/src/main/java/com/zulipmobile/MainActivity.java @@ -1,7 +1,5 @@ package com.zulipmobile; -import android.content.Intent; -import android.content.res.Configuration; import android.os.Bundle; import android.webkit.WebView; import com.facebook.react.ReactActivity; @@ -22,12 +20,4 @@ protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); WebView.setWebContentsDebuggingEnabled(true); } - - @Override - public void onConfigurationChanged(Configuration newConfig) { - super.onConfigurationChanged(newConfig); - Intent intent = new Intent("onConfigurationChanged"); - intent.putExtra("newConfig", newConfig); - this.sendBroadcast(intent); - } } diff --git a/android/app/src/main/java/com/zulipmobile/sharing/ReceiveShareActivity.kt b/android/app/src/main/java/com/zulipmobile/sharing/ReceiveShareActivity.kt index 4e9fcc188b1..d81733f6573 100644 --- a/android/app/src/main/java/com/zulipmobile/sharing/ReceiveShareActivity.kt +++ b/android/app/src/main/java/com/zulipmobile/sharing/ReceiveShareActivity.kt @@ -2,7 +2,6 @@ package com.zulipmobile.sharing import android.content.Context import android.content.Intent -import android.content.res.Configuration import android.net.Uri import android.os.Bundle import android.util.Log @@ -105,13 +104,6 @@ class ReceiveShareActivity : ReactActivity() { } return params } - - override fun onConfigurationChanged(newConfig: Configuration) { - super.onConfigurationChanged(newConfig) - val intent = Intent("onConfigurationChanged") - intent.putExtra("newConfig", newConfig) - this.sendBroadcast(intent) - } } class ShareParamsParseException(errorMessage: String) : RuntimeException(errorMessage) diff --git a/docs/howto/ios-tips.md b/docs/howto/ios-tips.md index 4390b2cf0d5..d8685386e8f 100644 --- a/docs/howto/ios-tips.md +++ b/docs/howto/ios-tips.md @@ -27,8 +27,8 @@ device name in package.json 2. Within the repo, `$ open ios/ZulipMobile.xcworkspace/` to open Xcode. Make sure you choose the one that ends in .xcworkspace, not .xcodeproj. -3. Change BundleIdentifier for both ZulipMobile and ZulipMobileTests to a -unique string, e.g. `ZulipMobile` in the 'General Tab' of your project. +3. Change BundleIdentifier for ZulipMobile to a unique string, e.g. + `ZulipMobile` in the 'General Tab' of your project. 4. Select your device as the `build target` (from [this guide](https://reactnative.dev/docs/running-on-device)) 5. Hit the `build and run` button (make sure your device is unlocked) 6. If it's the first time you're running the app, you need to trust the @@ -39,7 +39,7 @@ mobile networks If it's your first time installing an app on an iOS device, you need to obtain Apple Developer credentials that will allow you to sign the app. Register at https://developer.apple.com. Then use your Apple ID in Xcode -and choose it as your `Signing > Team` for both ZulipMobile and ZulipMobileTests. +and choose it as your `Signing > Team` for ZulipMobile. ### Tips when running on your iOS device When you change the BundleIdentifier and Team (required in order to run on a device), diff --git a/ios/Podfile b/ios/Podfile index 4c161238601..364d59d897a 100644 --- a/ios/Podfile +++ b/ios/Podfile @@ -38,10 +38,4 @@ target 'ZulipMobile' do # unimodules provides Expo packages individually. use_unimodules! - - target 'ZulipMobileTests' do - inherit! :search_paths - # Pods for testing - end - end diff --git a/ios/Podfile.lock b/ios/Podfile.lock index 285932a816a..a0f456b9368 100644 --- a/ios/Podfile.lock +++ b/ios/Podfile.lock @@ -71,6 +71,8 @@ PODS: - React-cxxreact (= 0.60.6) - React-jsi (= 0.60.6) - React-jsinspector (0.60.6) + - react-native-cameraroll (1.7.2): + - React - react-native-image-picker (0.14.3): - React - react-native-netinfo (3.2.1): @@ -167,6 +169,7 @@ DEPENDENCIES: - React-jsi (from `../node_modules/react-native/ReactCommon/jsi`) - React-jsiexecutor (from `../node_modules/react-native/ReactCommon/jsiexecutor`) - React-jsinspector (from `../node_modules/react-native/ReactCommon/jsinspector`) + - "react-native-cameraroll (from `../node_modules/@react-native-community/cameraroll`)" - react-native-image-picker (from `../node_modules/react-native-image-picker`) - "react-native-netinfo (from `../node_modules/@react-native-community/netinfo`)" - react-native-notifications (from `../node_modules/react-native-notifications`) @@ -251,6 +254,8 @@ EXTERNAL SOURCES: :path: "../node_modules/react-native/ReactCommon/jsiexecutor" React-jsinspector: :path: "../node_modules/react-native/ReactCommon/jsinspector" + react-native-cameraroll: + :path: "../node_modules/@react-native-community/cameraroll" react-native-image-picker: :path: "../node_modules/react-native-image-picker" react-native-netinfo: @@ -358,6 +363,7 @@ SPEC CHECKSUMS: React-jsi: 1a4248256b96fa453536a8dafe11b784e24e789d React-jsiexecutor: 2279e559b921d02dfc6253ebef3dcb3a9dc6c07e React-jsinspector: a58b86545a0185f69768e78ac96ca9fe43fa3694 + react-native-cameraroll: 06e60780a4e6e7bb9a588eca72506744cf6e133b react-native-image-picker: 3693786b3d5958c8f71deed66ec068b323565e0d react-native-netinfo: 0da34082d2cec3100c9b5073bb217e35f1142bdd react-native-notifications: ce37363008fe2d6a226da4e721eace23b6ae3ad9 @@ -399,6 +405,6 @@ SPEC CHECKSUMS: UMTaskManagerInterface: 1e70fe58b872355f0ecb44fb81bb1a16484047f0 yoga: 5079887aa3e4c62142d6bcee493022643ee4d730 -PODFILE CHECKSUM: 35e31db914557542fa277c2ec99e983927f39658 +PODFILE CHECKSUM: 21c8ba3e839e2d99477fac31255085d875c73084 COCOAPODS: 1.9.1 diff --git a/ios/ZulipMobile.xcodeproj/project.pbxproj b/ios/ZulipMobile.xcodeproj/project.pbxproj index 087a5ef8f9b..76837a1bf6b 100644 --- a/ios/ZulipMobile.xcodeproj/project.pbxproj +++ b/ios/ZulipMobile.xcodeproj/project.pbxproj @@ -7,12 +7,10 @@ objects = { /* Begin PBXBuildFile section */ - 00E356F31AD99517003FC87E /* ZulipMobileTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 00E356F21AD99517003FC87E /* ZulipMobileTests.m */; }; 13B07FBC1A68108700A75B9A /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB01A68108700A75B9A /* AppDelegate.m */; }; 13B07FBD1A68108700A75B9A /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB11A68108700A75B9A /* LaunchScreen.xib */; }; 13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB51A68108700A75B9A /* Images.xcassets */; }; 13B07FC11A68108700A75B9A /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB71A68108700A75B9A /* main.m */; }; - 3EE5D55E2431F20B7F410CFE /* libPods-ZulipMobileTests.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 338F4382FA4C3F52F95A1F5B /* libPods-ZulipMobileTests.a */; }; 42689E9C23466FF7007540AA /* webview in Resources */ = {isa = PBXBuildFile; fileRef = 42689E9B23466FF7007540AA /* webview */; }; A148FEFC1E9D8CB900479280 /* zulip.mp3 in Resources */ = {isa = PBXBuildFile; fileRef = A148FEFB1E9D8CB900479280 /* zulip.mp3 */; }; C091D09FD11FDDB8E939257D /* libPods-ZulipMobile.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 74F3CD22CB932FA7EEE0BB66 /* libPods-ZulipMobile.a */; }; @@ -20,22 +18,8 @@ ED297163215061F000B7C4FE /* JavaScriptCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = ED297162215061F000B7C4FE /* JavaScriptCore.framework */; }; /* End PBXBuildFile section */ -/* Begin PBXContainerItemProxy section */ - 00E356F41AD99517003FC87E /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 83CBB9F71A601CBA00E9B192 /* Project object */; - proxyType = 1; - remoteGlobalIDString = 13B07F861A680F5B00A75B9A; - remoteInfo = ZulipMobile; - }; -/* End PBXContainerItemProxy section */ - /* Begin PBXFileReference section */ 008F07F21AC5B25A0029DE68 /* main.jsbundle */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = main.jsbundle; sourceTree = ""; }; - 00E356EE1AD99517003FC87E /* ZulipMobileTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = ZulipMobileTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; - 00E356F11AD99517003FC87E /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - 00E356F21AD99517003FC87E /* ZulipMobileTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ZulipMobileTests.m; sourceTree = ""; }; - 047663CF32A867699B13342E /* Pods-ZulipMobileTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-ZulipMobileTests.debug.xcconfig"; path = "Target Support Files/Pods-ZulipMobileTests/Pods-ZulipMobileTests.debug.xcconfig"; sourceTree = ""; }; 13B07F961A680F5B00A75B9A /* ZulipMobile.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = ZulipMobile.app; sourceTree = BUILT_PRODUCTS_DIR; }; 13B07FAF1A68108700A75B9A /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AppDelegate.h; path = ZulipMobile/AppDelegate.h; sourceTree = ""; }; 13B07FB01A68108700A75B9A /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = AppDelegate.m; path = ZulipMobile/AppDelegate.m; sourceTree = ""; }; @@ -44,9 +28,7 @@ 13B07FB61A68108700A75B9A /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = Info.plist; path = ZulipMobile/Info.plist; sourceTree = ""; }; 13B07FB71A68108700A75B9A /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = main.m; path = ZulipMobile/main.m; sourceTree = ""; }; 2C68A2E34977F3A580059AC7 /* Pods-ZulipMobile.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-ZulipMobile.release.xcconfig"; path = "Target Support Files/Pods-ZulipMobile/Pods-ZulipMobile.release.xcconfig"; sourceTree = ""; }; - 338F4382FA4C3F52F95A1F5B /* libPods-ZulipMobileTests.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-ZulipMobileTests.a"; sourceTree = BUILT_PRODUCTS_DIR; }; 3C4249EC1EF6E16500D245F1 /* ZulipMobile.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; name = ZulipMobile.entitlements; path = ZulipMobile/ZulipMobile.entitlements; sourceTree = ""; }; - 412BDA8A3FA264AE52430606 /* Pods-ZulipMobileTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-ZulipMobileTests.release.xcconfig"; path = "Target Support Files/Pods-ZulipMobileTests/Pods-ZulipMobileTests.release.xcconfig"; sourceTree = ""; }; 42689E9B23466FF7007540AA /* webview */ = {isa = PBXFileReference; lastKnownFileType = folder; path = webview; sourceTree = ""; }; 66E34CC6219226D10091B852 /* ZulipMobile-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "ZulipMobile-Bridging-Header.h"; sourceTree = ""; }; 74F3CD22CB932FA7EEE0BB66 /* libPods-ZulipMobile.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-ZulipMobile.a"; sourceTree = BUILT_PRODUCTS_DIR; }; @@ -60,14 +42,6 @@ /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ - 00E356EB1AD99517003FC87E /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - 3EE5D55E2431F20B7F410CFE /* libPods-ZulipMobileTests.a in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; 13B07F8C1A680F5B00A75B9A /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; @@ -80,23 +54,6 @@ /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ - 00E356EF1AD99517003FC87E /* ZulipMobileTests */ = { - isa = PBXGroup; - children = ( - 00E356F21AD99517003FC87E /* ZulipMobileTests.m */, - 00E356F01AD99517003FC87E /* Supporting Files */, - ); - path = ZulipMobileTests; - sourceTree = ""; - }; - 00E356F01AD99517003FC87E /* Supporting Files */ = { - isa = PBXGroup; - children = ( - 00E356F11AD99517003FC87E /* Info.plist */, - ); - name = "Supporting Files"; - sourceTree = ""; - }; 13B07FAE1A68108700A75B9A /* ZulipMobile */ = { isa = PBXGroup; children = ( @@ -121,7 +78,6 @@ ED297162215061F000B7C4FE /* JavaScriptCore.framework */, ED2971642150620600B7C4FE /* JavaScriptCore.framework */, 74F3CD22CB932FA7EEE0BB66 /* libPods-ZulipMobile.a */, - 338F4382FA4C3F52F95A1F5B /* libPods-ZulipMobileTests.a */, ); name = Frameworks; sourceTree = ""; @@ -141,7 +97,6 @@ CF6CFE2C1E7DC55100F687C7 /* Build-Phases */, 13B07FAE1A68108700A75B9A /* ZulipMobile */, 832341AE1AAA6A7D00B99B32 /* Libraries */, - 00E356EF1AD99517003FC87E /* ZulipMobileTests */, 83CBBA001A601CBA00E9B192 /* Products */, F9E946BE712842C5A02C7F51 /* Resources */, 35C857DE057BA42A6919FBE9 /* Frameworks */, @@ -156,7 +111,6 @@ isa = PBXGroup; children = ( 13B07F961A680F5B00A75B9A /* ZulipMobile.app */, - 00E356EE1AD99517003FC87E /* ZulipMobileTests.xctest */, ); name = Products; sourceTree = ""; @@ -173,8 +127,6 @@ children = ( FB0511DD408657240F6D4EA3 /* Pods-ZulipMobile.debug.xcconfig */, 2C68A2E34977F3A580059AC7 /* Pods-ZulipMobile.release.xcconfig */, - 047663CF32A867699B13342E /* Pods-ZulipMobileTests.debug.xcconfig */, - 412BDA8A3FA264AE52430606 /* Pods-ZulipMobileTests.release.xcconfig */, ); path = Pods; sourceTree = ""; @@ -189,25 +141,6 @@ /* End PBXGroup section */ /* Begin PBXNativeTarget section */ - 00E356ED1AD99517003FC87E /* ZulipMobileTests */ = { - isa = PBXNativeTarget; - buildConfigurationList = 00E357021AD99517003FC87E /* Build configuration list for PBXNativeTarget "ZulipMobileTests" */; - buildPhases = ( - C79D8C2DFCC8DCDDB6559E65 /* [CP] Check Pods Manifest.lock */, - 00E356EA1AD99517003FC87E /* Sources */, - 00E356EB1AD99517003FC87E /* Frameworks */, - 00E356EC1AD99517003FC87E /* Resources */, - ); - buildRules = ( - ); - dependencies = ( - 00E356F51AD99517003FC87E /* PBXTargetDependency */, - ); - name = ZulipMobileTests; - productName = ZulipMobileTests; - productReference = 00E356EE1AD99517003FC87E /* ZulipMobileTests.xctest */; - productType = "com.apple.product-type.bundle.unit-test"; - }; 13B07F861A680F5B00A75B9A /* ZulipMobile */ = { isa = PBXNativeTarget; buildConfigurationList = 13B07F931A680F5B00A75B9A /* Build configuration list for PBXNativeTarget "ZulipMobile" */; @@ -240,10 +173,6 @@ LastUpgradeCheck = 940; ORGANIZATIONNAME = Facebook; TargetAttributes = { - 00E356ED1AD99517003FC87E = { - CreatedOnToolsVersion = 6.2; - TestTargetID = 13B07F861A680F5B00A75B9A; - }; 13B07F861A680F5B00A75B9A = { DevelopmentTeam = 66KHCWMEYB; LastSwiftMigration = 1010; @@ -274,19 +203,11 @@ projectRoot = ""; targets = ( 13B07F861A680F5B00A75B9A /* ZulipMobile */, - 00E356ED1AD99517003FC87E /* ZulipMobileTests */, ); }; /* End PBXProject section */ /* Begin PBXResourcesBuildPhase section */ - 00E356EC1AD99517003FC87E /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; 13B07F8E1A680F5B00A75B9A /* Resources */ = { isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; @@ -417,28 +338,6 @@ shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-ZulipMobile/Pods-ZulipMobile-resources.sh\"\n"; showEnvVarsInLog = 0; }; - C79D8C2DFCC8DCDDB6559E65 /* [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-ZulipMobileTests-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; - }; CF6CFE0C1E7DC27200F687C7 /* Run Script: tools/build-webview */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; @@ -456,14 +355,6 @@ /* End PBXShellScriptBuildPhase section */ /* Begin PBXSourcesBuildPhase section */ - 00E356EA1AD99517003FC87E /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 00E356F31AD99517003FC87E /* ZulipMobileTests.m in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; 13B07F871A680F5B00A75B9A /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; @@ -476,14 +367,6 @@ }; /* End PBXSourcesBuildPhase section */ -/* Begin PBXTargetDependency section */ - 00E356F51AD99517003FC87E /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - target = 13B07F861A680F5B00A75B9A /* ZulipMobile */; - targetProxy = 00E356F41AD99517003FC87E /* PBXContainerItemProxy */; - }; -/* End PBXTargetDependency section */ - /* Begin PBXVariantGroup section */ 13B07FB11A68108700A75B9A /* LaunchScreen.xib */ = { isa = PBXVariantGroup; @@ -497,59 +380,6 @@ /* End PBXVariantGroup section */ /* Begin XCBuildConfiguration section */ - 00E356F61AD99517003FC87E /* Debug */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 047663CF32A867699B13342E /* Pods-ZulipMobileTests.debug.xcconfig */; - buildSettings = { - ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; - BUNDLE_LOADER = "$(TEST_HOST)"; - GCC_PREPROCESSOR_DEFINITIONS = ( - "DEBUG=1", - "$(inherited)", - ); - HEADER_SEARCH_PATHS = "$(inherited)"; - INFOPLIST_FILE = ZulipMobileTests/Info.plist; - IPHONEOS_DEPLOYMENT_TARGET = 10.3; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - LIBRARY_SEARCH_PATHS = ( - "$(inherited)", - "\"$(SRCROOT)/$(TARGET_NAME)\"", - "\"$(SRCROOT)/$(TARGET_NAME)\"", - ); - OTHER_LDFLAGS = ( - "$(inherited)", - "-lc++", - ); - PRODUCT_NAME = "$(TARGET_NAME)"; - TEST_HOST = "$(BUILT_PRODUCTS_DIR)/ZulipMobile.app/ZulipMobile"; - }; - name = Debug; - }; - 00E356F71AD99517003FC87E /* Release */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 412BDA8A3FA264AE52430606 /* Pods-ZulipMobileTests.release.xcconfig */; - buildSettings = { - ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; - BUNDLE_LOADER = "$(TEST_HOST)"; - COPY_PHASE_STRIP = NO; - HEADER_SEARCH_PATHS = "$(inherited)"; - INFOPLIST_FILE = ZulipMobileTests/Info.plist; - IPHONEOS_DEPLOYMENT_TARGET = 10.3; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - LIBRARY_SEARCH_PATHS = ( - "$(inherited)", - "\"$(SRCROOT)/$(TARGET_NAME)\"", - "\"$(SRCROOT)/$(TARGET_NAME)\"", - ); - OTHER_LDFLAGS = ( - "$(inherited)", - "-lc++", - ); - PRODUCT_NAME = "$(TARGET_NAME)"; - TEST_HOST = "$(BUILT_PRODUCTS_DIR)/ZulipMobile.app/ZulipMobile"; - }; - name = Release; - }; 13B07F941A680F5B00A75B9A /* Debug */ = { isa = XCBuildConfiguration; baseConfigurationReference = FB0511DD408657240F6D4EA3 /* Pods-ZulipMobile.debug.xcconfig */; @@ -714,15 +544,6 @@ /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ - 00E357021AD99517003FC87E /* Build configuration list for PBXNativeTarget "ZulipMobileTests" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 00E356F61AD99517003FC87E /* Debug */, - 00E356F71AD99517003FC87E /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; 13B07F931A680F5B00A75B9A /* Build configuration list for PBXNativeTarget "ZulipMobile" */ = { isa = XCConfigurationList; buildConfigurations = ( diff --git a/ios/ZulipMobile.xcodeproj/xcshareddata/xcschemes/ZulipMobile release-mode.xcscheme b/ios/ZulipMobile.xcodeproj/xcshareddata/xcschemes/ZulipMobile release-mode.xcscheme index 01a1e868058..0e2414f0a22 100644 --- a/ios/ZulipMobile.xcodeproj/xcshareddata/xcschemes/ZulipMobile release-mode.xcscheme +++ b/ios/ZulipMobile.xcodeproj/xcshareddata/xcschemes/ZulipMobile release-mode.xcscheme @@ -20,20 +20,6 @@ ReferencedContainer = "container:ZulipMobile.xcodeproj"> - - - - - - - - - - - - - - - - - - - - CFBundleDevelopmentRegion - en - CFBundleExecutable - $(EXECUTABLE_NAME) - CFBundleIdentifier - $(PRODUCT_BUNDLE_IDENTIFIER) - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - $(PRODUCT_NAME) - CFBundlePackageType - BNDL - CFBundleShortVersionString - 1.0 - CFBundleSignature - ???? - CFBundleVersion - 1 - NSPhotoLibraryUsageDescription - This app requires access to the photo library. - - diff --git a/ios/ZulipMobileTests/ZulipMobileTests.m b/ios/ZulipMobileTests/ZulipMobileTests.m deleted file mode 100644 index 2ccea30713d..00000000000 --- a/ios/ZulipMobileTests/ZulipMobileTests.m +++ /dev/null @@ -1,70 +0,0 @@ -/** - * Copyright (c) Facebook, Inc. and its affiliates. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ - -#import -#import - -#import -#import - -#define TIMEOUT_SECONDS 600 -#define TEXT_TO_LOOK_FOR @"Welcome to React Native!" - -@interface ZulipMobileTests : XCTestCase - -@end - -@implementation ZulipMobileTests - -- (BOOL)findSubviewInView:(UIView *)view matching:(BOOL(^)(UIView *view))test -{ - if (test(view)) { - return YES; - } - for (UIView *subview in [view subviews]) { - if ([self findSubviewInView:subview matching:test]) { - return YES; - } - } - return NO; -} - -- (void)testRendersWelcomeScreen -{ - UIViewController *vc = [[[RCTSharedApplication() delegate] window] rootViewController]; - NSDate *date = [NSDate dateWithTimeIntervalSinceNow:TIMEOUT_SECONDS]; - BOOL foundElement = NO; - - __block NSString *redboxError = nil; - RCTSetLogFunction(^(RCTLogLevel level, RCTLogSource source, NSString *fileName, NSNumber *lineNumber, NSString *message) { - if (level >= RCTLogLevelError) { - redboxError = message; - } - }); - - while ([date timeIntervalSinceNow] > 0 && !foundElement && !redboxError) { - [[NSRunLoop mainRunLoop] runMode:NSDefaultRunLoopMode beforeDate:[NSDate dateWithTimeIntervalSinceNow:0.1]]; - [[NSRunLoop mainRunLoop] runMode:NSRunLoopCommonModes beforeDate:[NSDate dateWithTimeIntervalSinceNow:0.1]]; - - foundElement = [self findSubviewInView:vc.view matching:^BOOL(UIView *view) { - if ([view.accessibilityLabel isEqualToString:TEXT_TO_LOOK_FOR]) { - return YES; - } - return NO; - }]; - } - - RCTSetLogFunction(RCTDefaultLogFunction); - - XCTAssertNil(redboxError, @"RedBox error: %@", redboxError); - XCTAssertTrue(foundElement, @"Couldn't find element with text '%@' in %d seconds", TEXT_TO_LOOK_FOR, TIMEOUT_SECONDS); -} - - -@end diff --git a/jest.config.js b/jest.config.js index 6beeade92fc..22810f3ba57 100644 --- a/jest.config.js +++ b/jest.config.js @@ -2,10 +2,11 @@ // therefore need to be compiled by Babel before Jest can use them. // // These will be used as regexp fragments. -const uncompiledModules = [ +const transformModulesWhitelist = [ 'react-native', // @rnc/async-storage itself is precompiled, but its mock-helper is not '@react-native-community/async-storage', + '@react-native-community/cameraroll', '@expo/react-native-action-sheet', 'react-navigation', '@sentry/react-native', @@ -18,7 +19,7 @@ const uncompiledModules = [ // https://jestjs.io/docs/en/tutorial-react-native#transformignorepatterns-customization // // (This value is correctly a string, not a RegExp.) -const transformIgnorePattern = `node_modules/(?!${uncompiledModules.join('|')})`; +const transformIgnorePattern = `node_modules/(?!${transformModulesWhitelist.join('|')})`; module.exports = { preset: 'react-native', diff --git a/package.json b/package.json index b72ae0afcf2..83721483d11 100644 --- a/package.json +++ b/package.json @@ -33,6 +33,7 @@ "dependencies": { "@expo/react-native-action-sheet": "^3.4.0", "@react-native-community/async-storage": "^1.6.3", + "@react-native-community/cameraroll": "^1.7.2", "@react-native-community/netinfo": "^3.2.1", "@sentry/react-native": "^1.0.9", "@unimodules/core": "~4.0.0", diff --git a/src/animation/AnimatedScaleComponent.js b/src/animation/AnimatedScaleComponent.js index e80407e4186..59e083e5b24 100644 --- a/src/animation/AnimatedScaleComponent.js +++ b/src/animation/AnimatedScaleComponent.js @@ -22,7 +22,7 @@ export default class AnimatedScaleComponent extends PureComponent animatedValue = new Animated.Value(this.props.visible ? 1 : 0); - componentWillReceiveProps(nextProps: Props) { + UNSAFE_componentWillReceiveProps(nextProps: Props) { if (nextProps.visible) { this.setState({ visible: true }); } diff --git a/src/compose/ComposeBox.js b/src/compose/ComposeBox.js index dbbe611de2d..4d4ec0c6dd2 100644 --- a/src/compose/ComposeBox.js +++ b/src/compose/ComposeBox.js @@ -272,7 +272,7 @@ class ComposeBox extends PureComponent { } }; - componentWillReceiveProps(nextProps: Props) { + UNSAFE_componentWillReceiveProps(nextProps: Props) { if (nextProps.editMessage !== this.props.editMessage) { const topic = isStreamNarrow(nextProps.narrow) && nextProps.editMessage diff --git a/src/lightbox/downloadImage.js b/src/lightbox/downloadImage.js index b8d603fb67d..e1fb93c413c 100644 --- a/src/lightbox/downloadImage.js +++ b/src/lightbox/downloadImage.js @@ -1,5 +1,6 @@ /* @flow strict-local */ -import { CameraRoll, Platform, PermissionsAndroid } from 'react-native'; +import { Platform, PermissionsAndroid } from 'react-native'; +import CameraRoll from '@react-native-community/cameraroll'; import RNFetchBlob from 'rn-fetch-blob'; import type { Auth } from '../api/transportTypes'; @@ -43,7 +44,7 @@ const androidEnsureStoragePermission = async (): Promise => { */ export default async (url: string, fileName: string, auth: Auth): Promise => { if (Platform.OS === 'ios') { - return CameraRoll.saveToCameraRoll(url); + return CameraRoll.save(url); } // Platform.OS === 'android' diff --git a/src/redux-persist-migrate/index.js b/src/redux-persist-migrate/index.js index 3a8e59202c2..ca3ec13865a 100644 --- a/src/redux-persist-migrate/index.js +++ b/src/redux-persist-migrate/index.js @@ -1,5 +1,5 @@ /* @flow strict-local */ -import type { Reducer, Store, Dispatch } from 'redux'; +import type { Dispatch, StoreEnhancer } from 'redux'; import { REHYDRATE } from '../actionConstants'; import type { Action, GlobalState as State } from '../types'; @@ -13,9 +13,6 @@ const processKey = key => { return int; }; -type InnerStoreCreator = (Reducer, S | void) => Store; -type StoreEnhancer = (InnerStoreCreator) => InnerStoreCreator; - /* eslint-disable no-use-before-define */ export default function createMigration( diff --git a/yarn.lock b/yarn.lock index cce3023a5b9..2af07960f69 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1054,6 +1054,11 @@ resolved "https://registry.yarnpkg.com/@react-native-community/async-storage/-/async-storage-1.6.3.tgz#1a713e8c5cacd543ab8539080a5ce57ad917da88" integrity sha512-67K2akX90uc252zKMYJt1wISvaEH6ARtdTI9bUkwmOFXVPyVk1DfPnaRmyUzcVdeCBOO1n0xv9YO2GSppIormQ== +"@react-native-community/cameraroll@^1.7.2": + version "1.7.2" + resolved "https://registry.yarnpkg.com/@react-native-community/cameraroll/-/cameraroll-1.7.2.tgz#d1fc3770fb3c2ab85456cff0a587f756ae4838bf" + integrity sha512-qPIE+53Q3T41jD32W6YvzzwZteAwldMttroER2an2yrSoZbIP4r74DOWYLAv2FqS3NBs1k4jQ+fMp5rL22HtkQ== + "@react-native-community/cli-platform-android@^2.6.0", "@react-native-community/cli-platform-android@^2.9.0": version "2.9.0" resolved "https://registry.yarnpkg.com/@react-native-community/cli-platform-android/-/cli-platform-android-2.9.0.tgz#28831e61ce565a2c7d1905852fce1eecfd33cb5e"