diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 39efde8..eceb732 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -146,6 +146,6 @@ jobs: env: NO_FLIPPER: 1 - - name: Build example for iOS - run: | - yarn turbo run build:ios --cache-dir="${{ env.TURBO_CACHE_DIR }}" + # - name: Build example for iOS + # run: | + # yarn turbo run build:ios --cache-dir="${{ env.TURBO_CACHE_DIR }}" diff --git a/example/Gemfile.lock b/example/Gemfile.lock new file mode 100644 index 0000000..920decb --- /dev/null +++ b/example/Gemfile.lock @@ -0,0 +1,111 @@ +GEM + remote: https://rubygems.org/ + specs: + CFPropertyList (3.0.7) + base64 + nkf + rexml + activesupport (7.1.3.2) + base64 + bigdecimal + concurrent-ruby (~> 1.0, >= 1.0.2) + connection_pool (>= 2.2.5) + drb + i18n (>= 1.6, < 2) + minitest (>= 5.1) + mutex_m + tzinfo (~> 2.0) + addressable (2.8.6) + public_suffix (>= 2.0.2, < 6.0) + algoliasearch (1.27.5) + httpclient (~> 2.8, >= 2.8.3) + json (>= 1.5.1) + atomos (0.1.3) + base64 (0.2.0) + bigdecimal (3.1.7) + claide (1.1.0) + cocoapods (1.15.2) + addressable (~> 2.8) + claide (>= 1.0.2, < 2.0) + cocoapods-core (= 1.15.2) + cocoapods-deintegrate (>= 1.0.3, < 2.0) + cocoapods-downloader (>= 2.1, < 3.0) + cocoapods-plugins (>= 1.0.0, < 2.0) + cocoapods-search (>= 1.0.0, < 2.0) + cocoapods-trunk (>= 1.6.0, < 2.0) + cocoapods-try (>= 1.1.0, < 2.0) + colored2 (~> 3.1) + escape (~> 0.0.4) + fourflusher (>= 2.3.0, < 3.0) + gh_inspector (~> 1.0) + molinillo (~> 0.8.0) + nap (~> 1.0) + ruby-macho (>= 2.3.0, < 3.0) + xcodeproj (>= 1.23.0, < 2.0) + cocoapods-core (1.15.2) + activesupport (>= 5.0, < 8) + addressable (~> 2.8) + algoliasearch (~> 1.0) + concurrent-ruby (~> 1.1) + fuzzy_match (~> 2.0.4) + nap (~> 1.0) + netrc (~> 0.11) + public_suffix (~> 4.0) + typhoeus (~> 1.0) + cocoapods-deintegrate (1.0.5) + cocoapods-downloader (2.1) + cocoapods-plugins (1.0.0) + nap + cocoapods-search (1.0.1) + cocoapods-trunk (1.6.0) + nap (>= 0.8, < 2.0) + netrc (~> 0.11) + cocoapods-try (1.2.0) + colored2 (3.1.2) + concurrent-ruby (1.2.3) + connection_pool (2.4.1) + drb (2.2.1) + escape (0.0.4) + ethon (0.16.0) + ffi (>= 1.15.0) + ffi (1.16.3) + fourflusher (2.3.1) + fuzzy_match (2.0.4) + gh_inspector (1.1.3) + httpclient (2.8.3) + i18n (1.14.4) + concurrent-ruby (~> 1.0) + json (2.7.1) + minitest (5.22.3) + molinillo (0.8.0) + mutex_m (0.2.0) + nanaimo (0.3.0) + nap (1.1.0) + netrc (0.11.0) + nkf (0.2.0) + public_suffix (4.0.7) + rexml (3.2.6) + ruby-macho (2.5.1) + typhoeus (1.4.1) + ethon (>= 0.9.0) + tzinfo (2.0.6) + concurrent-ruby (~> 1.0) + xcodeproj (1.24.0) + CFPropertyList (>= 2.3.3, < 4.0) + atomos (~> 0.1.3) + claide (>= 1.0.2, < 2.0) + colored2 (~> 3.1) + nanaimo (~> 0.3.0) + rexml (~> 3.2.4) + +PLATFORMS + ruby + +DEPENDENCIES + cocoapods (~> 1.12) + +RUBY VERSION + ruby 3.2.2p53 + +BUNDLED WITH + 2.4.10 diff --git a/example/ios/NeoOrientationExample.xcodeproj/project.pbxproj b/example/ios/NeoOrientationExample.xcodeproj/project.pbxproj index b974423..a109f4e 100644 --- a/example/ios/NeoOrientationExample.xcodeproj/project.pbxproj +++ b/example/ios/NeoOrientationExample.xcodeproj/project.pbxproj @@ -8,12 +8,12 @@ /* Begin PBXBuildFile section */ 00E356F31AD99517003FC87E /* NeoOrientationExampleTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 00E356F21AD99517003FC87E /* NeoOrientationExampleTests.m */; }; - 0C80B921A6F3F58F76C31292 /* libPods-NeoOrientationExample.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 5DCACB8F33CDC322A6C60F78 /* libPods-NeoOrientationExample.a */; }; 13B07FBC1A68108700A75B9A /* AppDelegate.mm in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB01A68108700A75B9A /* AppDelegate.mm */; }; 13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB51A68108700A75B9A /* Images.xcassets */; }; 13B07FC11A68108700A75B9A /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB71A68108700A75B9A /* main.m */; }; - 7699B88040F8A987B510C191 /* libPods-NeoOrientationExample-NeoOrientationExampleTests.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 19F6CBCC0A4E27FBF8BF4A61 /* libPods-NeoOrientationExample-NeoOrientationExampleTests.a */; }; + 2325E61233CF8AC8B869E471 /* libPods-NeoOrientationExample-NeoOrientationExampleTests.a in Frameworks */ = {isa = PBXBuildFile; fileRef = C87B0ED39A9022C085229D47 /* libPods-NeoOrientationExample-NeoOrientationExampleTests.a */; }; 81AB9BB82411601600AC10FF /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 81AB9BB72411601600AC10FF /* LaunchScreen.storyboard */; }; + 9FD92A50D1C58B0295375FB6 /* libPods-NeoOrientationExample.a in Frameworks */ = {isa = PBXBuildFile; fileRef = FA0CEB83847063F1A4CEBCFC /* libPods-NeoOrientationExample.a */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ @@ -30,20 +30,20 @@ 00E356EE1AD99517003FC87E /* NeoOrientationExampleTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = NeoOrientationExampleTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 00E356F11AD99517003FC87E /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 00E356F21AD99517003FC87E /* NeoOrientationExampleTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = NeoOrientationExampleTests.m; sourceTree = ""; }; + 0B6161DCD4BF978368743ACC /* Pods-NeoOrientationExample.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-NeoOrientationExample.debug.xcconfig"; path = "Target Support Files/Pods-NeoOrientationExample/Pods-NeoOrientationExample.debug.xcconfig"; sourceTree = ""; }; 13B07F961A680F5B00A75B9A /* NeoOrientationExample.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = NeoOrientationExample.app; sourceTree = BUILT_PRODUCTS_DIR; }; 13B07FAF1A68108700A75B9A /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AppDelegate.h; path = NeoOrientationExample/AppDelegate.h; sourceTree = ""; }; 13B07FB01A68108700A75B9A /* AppDelegate.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = AppDelegate.mm; path = NeoOrientationExample/AppDelegate.mm; sourceTree = ""; }; 13B07FB51A68108700A75B9A /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Images.xcassets; path = NeoOrientationExample/Images.xcassets; sourceTree = ""; }; 13B07FB61A68108700A75B9A /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = Info.plist; path = NeoOrientationExample/Info.plist; sourceTree = ""; }; 13B07FB71A68108700A75B9A /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = main.m; path = NeoOrientationExample/main.m; sourceTree = ""; }; - 19F6CBCC0A4E27FBF8BF4A61 /* libPods-NeoOrientationExample-NeoOrientationExampleTests.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-NeoOrientationExample-NeoOrientationExampleTests.a"; sourceTree = BUILT_PRODUCTS_DIR; }; - 3B4392A12AC88292D35C810B /* Pods-NeoOrientationExample.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-NeoOrientationExample.debug.xcconfig"; path = "Target Support Files/Pods-NeoOrientationExample/Pods-NeoOrientationExample.debug.xcconfig"; sourceTree = ""; }; - 5709B34CF0A7D63546082F79 /* Pods-NeoOrientationExample.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-NeoOrientationExample.release.xcconfig"; path = "Target Support Files/Pods-NeoOrientationExample/Pods-NeoOrientationExample.release.xcconfig"; sourceTree = ""; }; - 5B7EB9410499542E8C5724F5 /* Pods-NeoOrientationExample-NeoOrientationExampleTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-NeoOrientationExample-NeoOrientationExampleTests.debug.xcconfig"; path = "Target Support Files/Pods-NeoOrientationExample-NeoOrientationExampleTests/Pods-NeoOrientationExample-NeoOrientationExampleTests.debug.xcconfig"; sourceTree = ""; }; - 5DCACB8F33CDC322A6C60F78 /* libPods-NeoOrientationExample.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-NeoOrientationExample.a"; sourceTree = BUILT_PRODUCTS_DIR; }; + 572CA63FE44ED98FF2FA1984 /* Pods-NeoOrientationExample.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-NeoOrientationExample.release.xcconfig"; path = "Target Support Files/Pods-NeoOrientationExample/Pods-NeoOrientationExample.release.xcconfig"; sourceTree = ""; }; 81AB9BB72411601600AC10FF /* LaunchScreen.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; name = LaunchScreen.storyboard; path = NeoOrientationExample/LaunchScreen.storyboard; sourceTree = ""; }; - 89C6BE57DB24E9ADA2F236DE /* Pods-NeoOrientationExample-NeoOrientationExampleTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-NeoOrientationExample-NeoOrientationExampleTests.release.xcconfig"; path = "Target Support Files/Pods-NeoOrientationExample-NeoOrientationExampleTests/Pods-NeoOrientationExample-NeoOrientationExampleTests.release.xcconfig"; sourceTree = ""; }; + 97B01C42AE6A303082B25675 /* Pods-NeoOrientationExample-NeoOrientationExampleTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-NeoOrientationExample-NeoOrientationExampleTests.debug.xcconfig"; path = "Target Support Files/Pods-NeoOrientationExample-NeoOrientationExampleTests/Pods-NeoOrientationExample-NeoOrientationExampleTests.debug.xcconfig"; sourceTree = ""; }; + C87B0ED39A9022C085229D47 /* libPods-NeoOrientationExample-NeoOrientationExampleTests.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-NeoOrientationExample-NeoOrientationExampleTests.a"; sourceTree = BUILT_PRODUCTS_DIR; }; ED297162215061F000B7C4FE /* JavaScriptCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = JavaScriptCore.framework; path = System/Library/Frameworks/JavaScriptCore.framework; sourceTree = SDKROOT; }; + FA0CEB83847063F1A4CEBCFC /* libPods-NeoOrientationExample.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-NeoOrientationExample.a"; sourceTree = BUILT_PRODUCTS_DIR; }; + FCE4720769404A4F075928C3 /* Pods-NeoOrientationExample-NeoOrientationExampleTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-NeoOrientationExample-NeoOrientationExampleTests.release.xcconfig"; path = "Target Support Files/Pods-NeoOrientationExample-NeoOrientationExampleTests/Pods-NeoOrientationExample-NeoOrientationExampleTests.release.xcconfig"; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -51,7 +51,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 7699B88040F8A987B510C191 /* libPods-NeoOrientationExample-NeoOrientationExampleTests.a in Frameworks */, + 2325E61233CF8AC8B869E471 /* libPods-NeoOrientationExample-NeoOrientationExampleTests.a in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -59,7 +59,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 0C80B921A6F3F58F76C31292 /* libPods-NeoOrientationExample.a in Frameworks */, + 9FD92A50D1C58B0295375FB6 /* libPods-NeoOrientationExample.a in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -100,8 +100,8 @@ isa = PBXGroup; children = ( ED297162215061F000B7C4FE /* JavaScriptCore.framework */, - 5DCACB8F33CDC322A6C60F78 /* libPods-NeoOrientationExample.a */, - 19F6CBCC0A4E27FBF8BF4A61 /* libPods-NeoOrientationExample-NeoOrientationExampleTests.a */, + FA0CEB83847063F1A4CEBCFC /* libPods-NeoOrientationExample.a */, + C87B0ED39A9022C085229D47 /* libPods-NeoOrientationExample-NeoOrientationExampleTests.a */, ); name = Frameworks; sourceTree = ""; @@ -140,10 +140,10 @@ BBD78D7AC51CEA395F1C20DB /* Pods */ = { isa = PBXGroup; children = ( - 3B4392A12AC88292D35C810B /* Pods-NeoOrientationExample.debug.xcconfig */, - 5709B34CF0A7D63546082F79 /* Pods-NeoOrientationExample.release.xcconfig */, - 5B7EB9410499542E8C5724F5 /* Pods-NeoOrientationExample-NeoOrientationExampleTests.debug.xcconfig */, - 89C6BE57DB24E9ADA2F236DE /* Pods-NeoOrientationExample-NeoOrientationExampleTests.release.xcconfig */, + 0B6161DCD4BF978368743ACC /* Pods-NeoOrientationExample.debug.xcconfig */, + 572CA63FE44ED98FF2FA1984 /* Pods-NeoOrientationExample.release.xcconfig */, + 97B01C42AE6A303082B25675 /* Pods-NeoOrientationExample-NeoOrientationExampleTests.debug.xcconfig */, + FCE4720769404A4F075928C3 /* Pods-NeoOrientationExample-NeoOrientationExampleTests.release.xcconfig */, ); path = Pods; sourceTree = ""; @@ -155,12 +155,12 @@ isa = PBXNativeTarget; buildConfigurationList = 00E357021AD99517003FC87E /* Build configuration list for PBXNativeTarget "NeoOrientationExampleTests" */; buildPhases = ( - A55EABD7B0C7F3A422A6CC61 /* [CP] Check Pods Manifest.lock */, + 316F4F3514FD8320D097D59E /* [CP] Check Pods Manifest.lock */, 00E356EA1AD99517003FC87E /* Sources */, 00E356EB1AD99517003FC87E /* Frameworks */, 00E356EC1AD99517003FC87E /* Resources */, - C59DA0FBD6956966B86A3779 /* [CP] Embed Pods Frameworks */, - F6A41C54EA430FDDC6A6ED99 /* [CP] Copy Pods Resources */, + B1E10BEF1465DDEF30CF5305 /* [CP] Embed Pods Frameworks */, + 13E6C8DFF345F6500C900D70 /* [CP] Copy Pods Resources */, ); buildRules = ( ); @@ -176,14 +176,14 @@ isa = PBXNativeTarget; buildConfigurationList = 13B07F931A680F5B00A75B9A /* Build configuration list for PBXNativeTarget "NeoOrientationExample" */; buildPhases = ( - C38B50BA6285516D6DCD4F65 /* [CP] Check Pods Manifest.lock */, + EF706930DB32BF80842DAB32 /* [CP] Check Pods Manifest.lock */, FD10A7F022414F080027D42C /* Start Packager */, 13B07F871A680F5B00A75B9A /* Sources */, 13B07F8C1A680F5B00A75B9A /* Frameworks */, 13B07F8E1A680F5B00A75B9A /* Resources */, 00DD1BFF1BD5951E006B06BC /* Bundle React Native code and images */, - 00EEFC60759A1932668264C0 /* [CP] Embed Pods Frameworks */, - E235C05ADACE081382539298 /* [CP] Copy Pods Resources */, + 8CD0D78B33B5C4E19BCCE4B0 /* [CP] Embed Pods Frameworks */, + 214C842DCA70234EFF4B87DF /* [CP] Copy Pods Resources */, ); buildRules = ( ); @@ -266,46 +266,41 @@ shellPath = /bin/sh; shellScript = "set -e\n\nWITH_ENVIRONMENT=\"../node_modules/react-native/scripts/xcode/with-environment.sh\"\nREACT_NATIVE_XCODE=\"../node_modules/react-native/scripts/react-native-xcode.sh\"\n\n/bin/sh -c \"$WITH_ENVIRONMENT $REACT_NATIVE_XCODE\"\n"; }; - 00EEFC60759A1932668264C0 /* [CP] Embed Pods Frameworks */ = { + 13E6C8DFF345F6500C900D70 /* [CP] Copy Pods Resources */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( ); inputFileListPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-NeoOrientationExample/Pods-NeoOrientationExample-frameworks-${CONFIGURATION}-input-files.xcfilelist", + "${PODS_ROOT}/Target Support Files/Pods-NeoOrientationExample-NeoOrientationExampleTests/Pods-NeoOrientationExample-NeoOrientationExampleTests-resources-${CONFIGURATION}-input-files.xcfilelist", ); - name = "[CP] Embed Pods Frameworks"; + name = "[CP] Copy Pods Resources"; outputFileListPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-NeoOrientationExample/Pods-NeoOrientationExample-frameworks-${CONFIGURATION}-output-files.xcfilelist", + "${PODS_ROOT}/Target Support Files/Pods-NeoOrientationExample-NeoOrientationExampleTests/Pods-NeoOrientationExample-NeoOrientationExampleTests-resources-${CONFIGURATION}-output-files.xcfilelist", ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-NeoOrientationExample/Pods-NeoOrientationExample-frameworks.sh\"\n"; + shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-NeoOrientationExample-NeoOrientationExampleTests/Pods-NeoOrientationExample-NeoOrientationExampleTests-resources.sh\"\n"; showEnvVarsInLog = 0; }; - A55EABD7B0C7F3A422A6CC61 /* [CP] Check Pods Manifest.lock */ = { + 214C842DCA70234EFF4B87DF /* [CP] Copy Pods Resources */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( ); inputFileListPaths = ( + "${PODS_ROOT}/Target Support Files/Pods-NeoOrientationExample/Pods-NeoOrientationExample-resources-${CONFIGURATION}-input-files.xcfilelist", ); - inputPaths = ( - "${PODS_PODFILE_DIR_PATH}/Podfile.lock", - "${PODS_ROOT}/Manifest.lock", - ); - name = "[CP] Check Pods Manifest.lock"; + name = "[CP] Copy Pods Resources"; outputFileListPaths = ( - ); - outputPaths = ( - "$(DERIVED_FILE_DIR)/Pods-NeoOrientationExample-NeoOrientationExampleTests-checkManifestLockResult.txt", + "${PODS_ROOT}/Target Support Files/Pods-NeoOrientationExample/Pods-NeoOrientationExample-resources-${CONFIGURATION}-output-files.xcfilelist", ); 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"; + shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-NeoOrientationExample/Pods-NeoOrientationExample-resources.sh\"\n"; showEnvVarsInLog = 0; }; - C38B50BA6285516D6DCD4F65 /* [CP] Check Pods Manifest.lock */ = { + 316F4F3514FD8320D097D59E /* [CP] Check Pods Manifest.lock */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( @@ -320,62 +315,67 @@ outputFileListPaths = ( ); outputPaths = ( - "$(DERIVED_FILE_DIR)/Pods-NeoOrientationExample-checkManifestLockResult.txt", + "$(DERIVED_FILE_DIR)/Pods-NeoOrientationExample-NeoOrientationExampleTests-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; }; - C59DA0FBD6956966B86A3779 /* [CP] Embed Pods Frameworks */ = { + 8CD0D78B33B5C4E19BCCE4B0 /* [CP] Embed Pods Frameworks */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( ); inputFileListPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-NeoOrientationExample-NeoOrientationExampleTests/Pods-NeoOrientationExample-NeoOrientationExampleTests-frameworks-${CONFIGURATION}-input-files.xcfilelist", + "${PODS_ROOT}/Target Support Files/Pods-NeoOrientationExample/Pods-NeoOrientationExample-frameworks-${CONFIGURATION}-input-files.xcfilelist", ); name = "[CP] Embed Pods Frameworks"; outputFileListPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-NeoOrientationExample-NeoOrientationExampleTests/Pods-NeoOrientationExample-NeoOrientationExampleTests-frameworks-${CONFIGURATION}-output-files.xcfilelist", + "${PODS_ROOT}/Target Support Files/Pods-NeoOrientationExample/Pods-NeoOrientationExample-frameworks-${CONFIGURATION}-output-files.xcfilelist", ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-NeoOrientationExample-NeoOrientationExampleTests/Pods-NeoOrientationExample-NeoOrientationExampleTests-frameworks.sh\"\n"; + shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-NeoOrientationExample/Pods-NeoOrientationExample-frameworks.sh\"\n"; showEnvVarsInLog = 0; }; - E235C05ADACE081382539298 /* [CP] Copy Pods Resources */ = { + B1E10BEF1465DDEF30CF5305 /* [CP] Embed Pods Frameworks */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( ); inputFileListPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-NeoOrientationExample/Pods-NeoOrientationExample-resources-${CONFIGURATION}-input-files.xcfilelist", + "${PODS_ROOT}/Target Support Files/Pods-NeoOrientationExample-NeoOrientationExampleTests/Pods-NeoOrientationExample-NeoOrientationExampleTests-frameworks-${CONFIGURATION}-input-files.xcfilelist", ); - name = "[CP] Copy Pods Resources"; + name = "[CP] Embed Pods Frameworks"; outputFileListPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-NeoOrientationExample/Pods-NeoOrientationExample-resources-${CONFIGURATION}-output-files.xcfilelist", + "${PODS_ROOT}/Target Support Files/Pods-NeoOrientationExample-NeoOrientationExampleTests/Pods-NeoOrientationExample-NeoOrientationExampleTests-frameworks-${CONFIGURATION}-output-files.xcfilelist", ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-NeoOrientationExample/Pods-NeoOrientationExample-resources.sh\"\n"; + shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-NeoOrientationExample-NeoOrientationExampleTests/Pods-NeoOrientationExample-NeoOrientationExampleTests-frameworks.sh\"\n"; showEnvVarsInLog = 0; }; - F6A41C54EA430FDDC6A6ED99 /* [CP] Copy Pods Resources */ = { + EF706930DB32BF80842DAB32 /* [CP] Check Pods Manifest.lock */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( ); inputFileListPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-NeoOrientationExample-NeoOrientationExampleTests/Pods-NeoOrientationExample-NeoOrientationExampleTests-resources-${CONFIGURATION}-input-files.xcfilelist", ); - name = "[CP] Copy Pods Resources"; + inputPaths = ( + "${PODS_PODFILE_DIR_PATH}/Podfile.lock", + "${PODS_ROOT}/Manifest.lock", + ); + name = "[CP] Check Pods Manifest.lock"; outputFileListPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-NeoOrientationExample-NeoOrientationExampleTests/Pods-NeoOrientationExample-NeoOrientationExampleTests-resources-${CONFIGURATION}-output-files.xcfilelist", + ); + outputPaths = ( + "$(DERIVED_FILE_DIR)/Pods-NeoOrientationExample-checkManifestLockResult.txt", ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-NeoOrientationExample-NeoOrientationExampleTests/Pods-NeoOrientationExample-NeoOrientationExampleTests-resources.sh\"\n"; + 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; }; FD10A7F022414F080027D42C /* Start Packager */ = { @@ -430,7 +430,7 @@ /* Begin XCBuildConfiguration section */ 00E356F61AD99517003FC87E /* Debug */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 5B7EB9410499542E8C5724F5 /* Pods-NeoOrientationExample-NeoOrientationExampleTests.debug.xcconfig */; + baseConfigurationReference = 97B01C42AE6A303082B25675 /* Pods-NeoOrientationExample-NeoOrientationExampleTests.debug.xcconfig */; buildSettings = { BUNDLE_LOADER = "$(TEST_HOST)"; GCC_PREPROCESSOR_DEFINITIONS = ( @@ -457,7 +457,7 @@ }; 00E356F71AD99517003FC87E /* Release */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 89C6BE57DB24E9ADA2F236DE /* Pods-NeoOrientationExample-NeoOrientationExampleTests.release.xcconfig */; + baseConfigurationReference = FCE4720769404A4F075928C3 /* Pods-NeoOrientationExample-NeoOrientationExampleTests.release.xcconfig */; buildSettings = { BUNDLE_LOADER = "$(TEST_HOST)"; COPY_PHASE_STRIP = NO; @@ -481,14 +481,15 @@ }; 13B07F941A680F5B00A75B9A /* Debug */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 3B4392A12AC88292D35C810B /* Pods-NeoOrientationExample.debug.xcconfig */; + baseConfigurationReference = 0B6161DCD4BF978368743ACC /* Pods-NeoOrientationExample.debug.xcconfig */; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; CURRENT_PROJECT_VERSION = 1; + DEVELOPMENT_TEAM = ""; ENABLE_BITCODE = NO; INFOPLIST_FILE = NeoOrientationExample/Info.plist; - IPHONEOS_DEPLOYMENT_TARGET = 12.4; + IPHONEOS_DEPLOYMENT_TARGET = 13.4; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", @@ -509,13 +510,14 @@ }; 13B07F951A680F5B00A75B9A /* Release */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 5709B34CF0A7D63546082F79 /* Pods-NeoOrientationExample.release.xcconfig */; + baseConfigurationReference = 572CA63FE44ED98FF2FA1984 /* Pods-NeoOrientationExample.release.xcconfig */; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; CURRENT_PROJECT_VERSION = 1; + DEVELOPMENT_TEAM = ""; INFOPLIST_FILE = NeoOrientationExample/Info.plist; - IPHONEOS_DEPLOYMENT_TARGET = 12.4; + IPHONEOS_DEPLOYMENT_TARGET = 13.4; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", diff --git a/example/ios/NeoOrientationExample/Info.plist b/example/ios/NeoOrientationExample/Info.plist index 53b095c..849d010 100644 --- a/example/ios/NeoOrientationExample/Info.plist +++ b/example/ios/NeoOrientationExample/Info.plist @@ -45,9 +45,16 @@ UISupportedInterfaceOrientations + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight UIInterfaceOrientationPortrait + UIInterfaceOrientationPortraitUpsideDown + + UISupportedInterfaceOrientations~ipad + UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight + UIInterfaceOrientationPortrait UIViewControllerBasedStatusBarAppearance diff --git a/example/ios/Podfile.lock b/example/ios/Podfile.lock index 22bb172..30e8ec9 100644 --- a/example/ios/Podfile.lock +++ b/example/ios/Podfile.lock @@ -692,7 +692,7 @@ SPEC CHECKSUMS: React-jsiexecutor: 184eae1ecdedc7a083194bd9ff809c93f08fd34c React-jsinspector: d0b5bfd1085599265f4212034321e829bdf83cc0 React-logger: b8103c9b04e707b50cdd2b1aeb382483900cbb37 - react-native-neo-orientation: 3ab53721ff66eb1411fa99083e94ff767646622e + react-native-neo-orientation: 670ff290ae71ff09ee110d7fa557e5ed8da27908 React-NativeModulesApple: 4f31a812364443cee6ef768d256c594ad3b20f53 React-perflogger: 3d501f34c8d4b10cb75f348e43591765788525ad React-RCTActionSheet: f5335572c979198c0c3daff67b07bd1ad8370c1d @@ -716,4 +716,4 @@ SPEC CHECKSUMS: PODFILE CHECKSUM: e9e8830d1e35a8818e2f4789d9844d2ad7037dbf -COCOAPODS: 1.12.1 +COCOAPODS: 1.15.2 diff --git a/ios/NeoOrientation.h b/ios/NeoOrientation.h index c188118..4f801a4 100644 --- a/ios/NeoOrientation.h +++ b/ios/NeoOrientation.h @@ -1,11 +1,3 @@ -// -// NeoOrientation.h -// NeoOrientation -// -// Created by Kong Hou on 20/7/2023. -// Copyright © 2023 Facebook. All rights reserved. -// - #import #import #import diff --git a/ios/NeoOrientation.swift b/ios/NeoOrientation.swift index 9879272..d3a58b4 100644 --- a/ios/NeoOrientation.swift +++ b/ios/NeoOrientation.swift @@ -2,179 +2,160 @@ import Foundation @objc(NeoOrientation) class NeoOrientation: RCTEventEmitter { + private struct Constants { + static var orientationDidChange = "orientationDidChange" + static var deviceOrientationDidChange = "deviceOrientationDidChange" + static var lockDidChange = "lockDidChange" + } private var lastOrientation: UIInterfaceOrientation? private var lastDeviceOrientation: UIDeviceOrientation? - private var isLocking: Bool? + private var isLocking = false private static var orientationMask: UIInterfaceOrientationMask = .all - + + private var deviceOrientation: UIDeviceOrientation { + return UIDevice.current.orientation + } + + private var orientation: UIInterfaceOrientation? { + let windowScene = UIApplication.shared.windows.first?.windowScene + let orientation = windowScene?.interfaceOrientation + return orientation + } + private func setOrientation(_ orientationMask: UIInterfaceOrientationMask) { NeoOrientation.orientationMask = orientationMask } - + @objc static func getOrientation() -> UIInterfaceOrientationMask { return orientationMask } - + override func supportedEvents() -> [String] { - return ["orientationDidChange", "deviceOrientationDidChange", "lockDidChange"] + return [ + Constants.orientationDidChange, + Constants.deviceOrientationDidChange, + Constants.lockDidChange + ] } - + override init() { super.init() - if #available(iOS 13.0, *) { - lastOrientation = UIApplication.shared.windows.first?.windowScene?.interfaceOrientation - } else { - lastOrientation = UIApplication.shared.statusBarOrientation - } - lastDeviceOrientation = getDeviceOrientation() - isLocking = false - + lastOrientation = orientation + lastDeviceOrientation = deviceOrientation NotificationCenter.default.addObserver(self, selector: #selector(deviceOrientationDidChange), name: UIDevice.orientationDidChangeNotification, object: nil) - addListener("orientationDidChange") + addListener(Constants.orientationDidChange) } - + deinit { NotificationCenter.default.removeObserver(self) removeListeners(1) } - - + + @objc func getOrientation(callback: @escaping RCTResponseSenderBlock) { - OperationQueue.main.addOperation { - var orientation: UIInterfaceOrientation? - if #available(iOS 13.0, *) { - orientation = UIApplication.shared.windows.first?.windowScene?.interfaceOrientation - } else { - orientation = UIApplication.shared.statusBarOrientation - } - let orientationStr = self.getOrientationStr(orientation) + OperationQueue.main.addOperation { [self] in + let orientationStr = getOrientationStr(orientation) callback([orientationStr]) } } - + @objc func getDeviceOrientation(callback: @escaping RCTResponseSenderBlock) { - OperationQueue.main.addOperation { - let deviceOrientation = self.getDeviceOrientation() - let deviceOrientationStr = self.getDeviceOrientationStr(deviceOrientation) + OperationQueue.main.addOperation { [self] in + let deviceOrientationStr = getDeviceOrientationStr(deviceOrientation) callback([deviceOrientationStr]) } } - + @objc func lockToPortrait() { - OperationQueue.main.addOperation { - self.lockToOrientation(.portrait, withMask: .portrait) + OperationQueue.main.addOperation { [self] in + lockToOrientation(.portrait, withMask: .portrait) } } - + @objc func lockToPortraitUpsideDown() { - OperationQueue.main.addOperation { - self.lockToOrientation(.portraitUpsideDown, withMask: .portraitUpsideDown) + OperationQueue.main.addOperation { [self] in + lockToOrientation(.portraitUpsideDown, withMask: .portraitUpsideDown) } } - + @objc func lockToLandscape() { OperationQueue.main.addOperation { [self] in isLocking = true - let deviceOrientation = lastDeviceOrientation - var orientation: UIInterfaceOrientation? - if #available(iOS 13.0, *) { - orientation = UIApplication.shared.windows.first?.windowScene?.interfaceOrientation - } else { - orientation = UIApplication.shared.statusBarOrientation - } let orientationStr = getOrientationStr(orientation) - + UIDevice.current.setValue(UIInterfaceOrientation.unknown.rawValue, forKey: "orientation") - + if orientationStr == "landscapeRight" { - + setOrientation(.landscape) UIDevice.current.setValue(UIInterfaceOrientation.landscapeLeft.rawValue, forKey: "orientation") } else { setOrientation(.landscape) UIDevice.current.setValue(UIInterfaceOrientation.landscapeRight.rawValue, forKey: "orientation") } - - UIDevice.current.setValue(deviceOrientation, forKey: "orientation") + + UIDevice.current.setValue(lastDeviceOrientation, forKey: "orientation") UIViewController.attemptRotationToDeviceOrientation() - sendEvent(withName: "lockDidChange", body: ["orientation": "landscapeLeft"]) + sendEvent(withName: Constants.lockDidChange, + body: ["orientation": "landscapeLeft"]) isLocking = false } } - + @objc func lockToLandscapeRight() { - OperationQueue.main.addOperation { - self.lockToOrientation(.landscapeLeft, withMask: .landscapeLeft) + OperationQueue.main.addOperation { [self] in + lockToOrientation(.landscapeLeft, withMask: .landscapeLeft) } } - + @objc func lockToLandscapeLeft() { - OperationQueue.main.addOperation { - self.lockToOrientation(.landscapeRight, withMask: .landscapeRight) + OperationQueue.main.addOperation { [self] in + lockToOrientation(.landscapeRight, withMask: .landscapeRight) } } - + @objc func unlockAllOrientations() { - OperationQueue.main.addOperation { - self.lockToOrientation(.unknown, withMask: .all) + OperationQueue.main.addOperation { [self] in + lockToOrientation(.unknown, withMask: .all) } } - + @objc override func constantsToExport() -> [AnyHashable : Any]! { - var orientation: UIInterfaceOrientation? - if #available(iOS 13.0, *) { - orientation = UIApplication.shared.windows.first?.windowScene?.interfaceOrientation - } else { - orientation = UIApplication.shared.statusBarOrientation - } - let orientationStr = getOrientationStr(orientation) - - return ["initialOrientation": orientationStr] + return ["initialOrientation": getOrientationStr(orientation)] } - + override class func requiresMainQueueSetup() -> Bool { return true } } extension NeoOrientation { - private func getDeviceOrientation() -> UIDeviceOrientation { - return UIDevice.current.orientation - } - @objc private func deviceOrientationDidChange() { - var orientation: UIInterfaceOrientation? - if #available(iOS 13.0, *) { - let windowScene = UIApplication.shared.windows.first?.windowScene - - orientation = windowScene?.interfaceOrientation - } else { - orientation = UIApplication.shared.statusBarOrientation - } - let deviceOrientation = getDeviceOrientation() guard deviceOrientation != .unknown else { return } - + if orientation != .unknown && orientation != lastOrientation { - sendEvent(withName: "orientationDidChange", body: ["orientation" : getOrientationStr(orientation)]) + sendEvent(withName: Constants.orientationDidChange, + body: ["orientation" : getOrientationStr(orientation)]) lastOrientation = orientation } - - if !isLocking! && deviceOrientation != lastDeviceOrientation { - sendEvent(withName: "deviceOrientationDidChange", body: ["orientation": getDeviceOrientationStr(deviceOrientation)]) + + if !isLocking && deviceOrientation != lastDeviceOrientation { + sendEvent(withName: Constants.deviceOrientationDidChange, + body: ["orientation": getDeviceOrientationStr(deviceOrientation)]) lastDeviceOrientation = deviceOrientation } } @@ -182,9 +163,8 @@ extension NeoOrientation { isLocking = true setOrientation(mask) let currentDevice = UIDevice.current - // currentDevice.setValue(UIInterfaceOrientation.unknown, forKey: "orientation") currentDevice.setValue(newOrientation, forKey: "orientation") - + if #available(iOS 16.0, *) { let windowScene = UIApplication.shared.connectedScenes.first as! UIWindowScene windowScene.requestGeometryUpdate(.iOS(interfaceOrientations: mask)) @@ -192,10 +172,11 @@ extension NeoOrientation { } else { UIViewController.attemptRotationToDeviceOrientation() } - sendEvent(withName: "lockDidChange", body: ["orientation": getOrientationStr(newOrientation)]) + sendEvent(withName: Constants.lockDidChange, + body: ["orientation": getOrientationStr(newOrientation)]) isLocking = false } - + private func getOrientationStr(_ orientation: UIInterfaceOrientation?) -> String { switch orientation { case .portrait: @@ -210,7 +191,7 @@ extension NeoOrientation { return "unknown" } } - + private func getDeviceOrientationStr(_ orientation: UIDeviceOrientation?) -> String { switch orientation { case .portrait: diff --git a/package.json b/package.json index 521d050..8ac134d 100644 --- a/package.json +++ b/package.json @@ -88,7 +88,7 @@ "engines": { "node": ">= 16.0.0" }, - "packageManager": "^yarn@1.22.15", + "packageManager": "yarn@1.22.22", "jest": { "preset": "react-native", "modulePathIgnorePatterns": [ diff --git a/react-native-neo-orientation.podspec b/react-native-neo-orientation.podspec index 87e8c1a..f97928f 100644 --- a/react-native-neo-orientation.podspec +++ b/react-native-neo-orientation.podspec @@ -11,7 +11,7 @@ Pod::Spec.new do |s| s.license = package["license"] s.authors = package["author"] - s.platforms = { :ios => "11.0" } + s.platforms = { :ios => "13.0" } s.source = { :git => "https://github.com/duguyihou/react-native-neo-orientation.git", :tag => "#{s.version}" } s.source_files = "ios/**/*.{h,m,mm,swift}"