From 6e28b64fb10b54c449a30073816d2efe231bc7e3 Mon Sep 17 00:00:00 2001 From: Andrey Belonogov Date: Thu, 28 May 2026 16:46:15 -0700 Subject: [PATCH 1/8] registerPlugin --- .../pubspec.lock | 37 +++--- apps/sse_contract_test_service/pubspec.lock | 2 +- .../flutter_client_sdk/example/.gitignore | 2 + .../ios/Flutter/AppFrameworkInfo.plist | 2 - .../example/ios/Flutter/Debug.xcconfig | 1 + .../example/ios/Flutter/Release.xcconfig | 1 + .../flutter_client_sdk/example/ios/Podfile | 43 +++++++ .../example/ios/Podfile.lock | 41 ++++++ .../ios/Runner.xcodeproj/project.pbxproj | 118 +++++++++++++++++- .../xcshareddata/xcschemes/Runner.xcscheme | 3 + .../contents.xcworkspacedata | 3 + .../example/ios/Runner/AppDelegate.swift | 9 +- .../example/ios/Runner/Info.plist | 29 ++++- .../macos/Flutter/Flutter-Debug.xcconfig | 1 + .../macos/Flutter/Flutter-Release.xcconfig | 1 + .../flutter_client_sdk/example/macos/Podfile | 42 +++++++ .../flutter_client_sdk/lib/src/ld_client.dart | 58 +++++++-- .../test/ld_client_plugin_test.dart | 109 +++++++++++++++- 18 files changed, 462 insertions(+), 40 deletions(-) create mode 100644 packages/flutter_client_sdk/example/ios/Podfile create mode 100644 packages/flutter_client_sdk/example/ios/Podfile.lock create mode 100644 packages/flutter_client_sdk/example/macos/Podfile diff --git a/apps/flutter_client_contract_test_service/pubspec.lock b/apps/flutter_client_contract_test_service/pubspec.lock index c256ee0a..7e87ead5 100644 --- a/apps/flutter_client_contract_test_service/pubspec.lock +++ b/apps/flutter_client_contract_test_service/pubspec.lock @@ -109,10 +109,10 @@ packages: dependency: transitive description: name: characters - sha256: f71061c654a3380576a52b451dd5532377954cf9dbd272a78fc8479606670803 + sha256: faf38497bda5ead2a8c7615f4f7939df04333478bf32e4173fcb06d428b5716b url: "https://pub.dev" source: hosted - version: "1.4.0" + version: "1.4.1" checked_yaml: dependency: transitive description: @@ -388,25 +388,28 @@ packages: source: hosted version: "6.8.0" launchdarkly_common_client: - dependency: "direct overridden" + dependency: transitive description: - path: "../../packages/common_client" - relative: true - source: path + name: launchdarkly_common_client + sha256: "02afb127aec6a5e9238005db02cb377ead5902d30207ef58ae8d4afe06aeae63" + url: "https://pub.dev" + source: hosted version: "1.9.0" launchdarkly_dart_common: - dependency: "direct overridden" + dependency: transitive description: - path: "../../packages/common" - relative: true - source: path + name: launchdarkly_dart_common + sha256: c25991ffc1ab2c951e31047955448970628c1c2dd09b1197bc527dc7dcdf2595 + url: "https://pub.dev" + source: hosted version: "1.8.0" launchdarkly_event_source_client: - dependency: "direct overridden" + dependency: transitive description: - path: "../../packages/event_source_client" - relative: true - source: path + name: launchdarkly_event_source_client + sha256: "51c90efe9765bf6908772abd59ea16c193798c1a9f9381475c56299cb553e3b2" + url: "https://pub.dev" + source: hosted version: "2.0.1" launchdarkly_flutter_client_sdk: dependency: "direct main" @@ -414,7 +417,7 @@ packages: path: "../../packages/flutter_client_sdk" relative: true source: path - version: "4.15.0" + version: "4.16.0" lints: dependency: "direct dev" description: @@ -451,10 +454,10 @@ packages: dependency: transitive description: name: material_color_utilities - sha256: f7142bb1154231d7ea5f96bc7bde4bda2a0945d2806bb11670e30b850d56bdec + sha256: "9c337007e82b1889149c82ed242ed1cb24a66044e30979c44912381e9be4c48b" url: "https://pub.dev" source: hosted - version: "0.11.1" + version: "0.13.0" meta: dependency: transitive description: diff --git a/apps/sse_contract_test_service/pubspec.lock b/apps/sse_contract_test_service/pubspec.lock index 6e42e705..b6af2058 100644 --- a/apps/sse_contract_test_service/pubspec.lock +++ b/apps/sse_contract_test_service/pubspec.lock @@ -311,7 +311,7 @@ packages: path: "../../packages/event_source_client" relative: true source: path - version: "2.0.1" + version: "2.1.0" lints: dependency: "direct dev" description: diff --git a/packages/flutter_client_sdk/example/.gitignore b/packages/flutter_client_sdk/example/.gitignore index 29a3a501..79c113f9 100644 --- a/packages/flutter_client_sdk/example/.gitignore +++ b/packages/flutter_client_sdk/example/.gitignore @@ -5,9 +5,11 @@ *.swp .DS_Store .atom/ +.build/ .buildlog/ .history .svn/ +.swiftpm/ migrate_working_dir/ # IntelliJ related diff --git a/packages/flutter_client_sdk/example/ios/Flutter/AppFrameworkInfo.plist b/packages/flutter_client_sdk/example/ios/Flutter/AppFrameworkInfo.plist index 7c569640..391a902b 100644 --- a/packages/flutter_client_sdk/example/ios/Flutter/AppFrameworkInfo.plist +++ b/packages/flutter_client_sdk/example/ios/Flutter/AppFrameworkInfo.plist @@ -20,7 +20,5 @@ ???? CFBundleVersion 1.0 - MinimumOSVersion - 12.0 diff --git a/packages/flutter_client_sdk/example/ios/Flutter/Debug.xcconfig b/packages/flutter_client_sdk/example/ios/Flutter/Debug.xcconfig index 592ceee8..ec97fc6f 100644 --- a/packages/flutter_client_sdk/example/ios/Flutter/Debug.xcconfig +++ b/packages/flutter_client_sdk/example/ios/Flutter/Debug.xcconfig @@ -1 +1,2 @@ +#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig" #include "Generated.xcconfig" diff --git a/packages/flutter_client_sdk/example/ios/Flutter/Release.xcconfig b/packages/flutter_client_sdk/example/ios/Flutter/Release.xcconfig index 592ceee8..c4855bfe 100644 --- a/packages/flutter_client_sdk/example/ios/Flutter/Release.xcconfig +++ b/packages/flutter_client_sdk/example/ios/Flutter/Release.xcconfig @@ -1 +1,2 @@ +#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig" #include "Generated.xcconfig" diff --git a/packages/flutter_client_sdk/example/ios/Podfile b/packages/flutter_client_sdk/example/ios/Podfile new file mode 100644 index 00000000..620e46eb --- /dev/null +++ b/packages/flutter_client_sdk/example/ios/Podfile @@ -0,0 +1,43 @@ +# Uncomment this line to define a global platform for your project +# platform :ios, '13.0' + +# CocoaPods analytics sends network stats synchronously affecting flutter build latency. +ENV['COCOAPODS_DISABLE_STATS'] = 'true' + +project 'Runner', { + 'Debug' => :debug, + 'Profile' => :release, + 'Release' => :release, +} + +def flutter_root + generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'Generated.xcconfig'), __FILE__) + unless File.exist?(generated_xcode_build_settings_path) + raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure flutter pub get is executed first" + end + + File.foreach(generated_xcode_build_settings_path) do |line| + matches = line.match(/FLUTTER_ROOT\=(.*)/) + return matches[1].strip if matches + end + raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Generated.xcconfig, then run flutter pub get" +end + +require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root) + +flutter_ios_podfile_setup + +target 'Runner' do + use_frameworks! + + flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__)) + target 'RunnerTests' do + inherit! :search_paths + end +end + +post_install do |installer| + installer.pods_project.targets.each do |target| + flutter_additional_ios_build_settings(target) + end +end diff --git a/packages/flutter_client_sdk/example/ios/Podfile.lock b/packages/flutter_client_sdk/example/ios/Podfile.lock new file mode 100644 index 00000000..b3217812 --- /dev/null +++ b/packages/flutter_client_sdk/example/ios/Podfile.lock @@ -0,0 +1,41 @@ +PODS: + - connectivity_plus (0.0.1): + - Flutter + - device_info_plus (0.0.1): + - Flutter + - Flutter (1.0.0) + - package_info_plus (0.4.5): + - Flutter + - shared_preferences_foundation (0.0.1): + - Flutter + - FlutterMacOS + +DEPENDENCIES: + - connectivity_plus (from `.symlinks/plugins/connectivity_plus/ios`) + - device_info_plus (from `.symlinks/plugins/device_info_plus/ios`) + - Flutter (from `Flutter`) + - package_info_plus (from `.symlinks/plugins/package_info_plus/ios`) + - shared_preferences_foundation (from `.symlinks/plugins/shared_preferences_foundation/darwin`) + +EXTERNAL SOURCES: + connectivity_plus: + :path: ".symlinks/plugins/connectivity_plus/ios" + device_info_plus: + :path: ".symlinks/plugins/device_info_plus/ios" + Flutter: + :path: Flutter + package_info_plus: + :path: ".symlinks/plugins/package_info_plus/ios" + shared_preferences_foundation: + :path: ".symlinks/plugins/shared_preferences_foundation/darwin" + +SPEC CHECKSUMS: + connectivity_plus: cb623214f4e1f6ef8fe7403d580fdad517d2f7dd + device_info_plus: 21fcca2080fbcd348be798aa36c3e5ed849eefbe + Flutter: cabc95a1d2626b1b06e7179b784ebcf0c0cde467 + package_info_plus: af8e2ca6888548050f16fa2f1938db7b5a5df499 + shared_preferences_foundation: 7036424c3d8ec98dfe75ff1667cb0cd531ec82bb + +PODFILE CHECKSUM: 3c63482e143d1b91d2d2560aee9fb04ecc74ac7e + +COCOAPODS: 1.16.2 diff --git a/packages/flutter_client_sdk/example/ios/Runner.xcodeproj/project.pbxproj b/packages/flutter_client_sdk/example/ios/Runner.xcodeproj/project.pbxproj index ce3bc8fc..52f702bc 100644 --- a/packages/flutter_client_sdk/example/ios/Runner.xcodeproj/project.pbxproj +++ b/packages/flutter_client_sdk/example/ios/Runner.xcodeproj/project.pbxproj @@ -10,10 +10,12 @@ 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; }; 331C808B294A63AB00263BE5 /* RunnerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 331C807B294A618700263BE5 /* RunnerTests.swift */; }; 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; }; + 4D12F76F78DAD09E3C83B7EB /* Pods_RunnerTests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8D24D0DC777017FF334A92E3 /* Pods_RunnerTests.framework */; }; 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; }; 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; }; 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; }; 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; }; + DE290C876972375F3CB7FE08 /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A320C0FBC18D5DB5A28E3BCE /* Pods_Runner.framework */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ @@ -42,12 +44,17 @@ /* Begin PBXFileReference section */ 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = ""; }; 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = ""; }; + 149D1CDB4F00766B1154D9DB /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = ""; }; + 18FF06663DDCC3FE1AF52BBB /* Pods-RunnerTests.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RunnerTests.profile.xcconfig"; path = "Target Support Files/Pods-RunnerTests/Pods-RunnerTests.profile.xcconfig"; sourceTree = ""; }; 331C807B294A618700263BE5 /* RunnerTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RunnerTests.swift; sourceTree = ""; }; 331C8081294A63A400263BE5 /* RunnerTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = RunnerTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = ""; }; 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = ""; }; 74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = ""; }; + 7C97A2D8B3C68D5BE9CE38CC /* Pods-RunnerTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RunnerTests.release.xcconfig"; path = "Target Support Files/Pods-RunnerTests/Pods-RunnerTests.release.xcconfig"; sourceTree = ""; }; + 8398D3525ED639A43CC83D65 /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; sourceTree = ""; }; + 8D24D0DC777017FF334A92E3 /* Pods_RunnerTests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_RunnerTests.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = ""; }; 9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = ""; }; 97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; }; @@ -55,13 +62,25 @@ 97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 9F0F12A21F633FC275B500CC /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = ""; }; + A320C0FBC18D5DB5A28E3BCE /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + CBD25C8C9EC55AB9C6CEBC82 /* Pods-RunnerTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RunnerTests.debug.xcconfig"; path = "Target Support Files/Pods-RunnerTests/Pods-RunnerTests.debug.xcconfig"; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ + 0048844A594938344EF9EA7C /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 4D12F76F78DAD09E3C83B7EB /* Pods_RunnerTests.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; 97C146EB1CF9000F007C117D /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + DE290C876972375F3CB7FE08 /* Pods_Runner.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -94,6 +113,8 @@ 97C146F01CF9000F007C117D /* Runner */, 97C146EF1CF9000F007C117D /* Products */, 331C8082294A63A400263BE5 /* RunnerTests */, + F571201148B6038FDD51D8B9 /* Pods */, + 9FBD962B08F2223EAE6B8C1B /* Frameworks */, ); sourceTree = ""; }; @@ -121,6 +142,29 @@ path = Runner; sourceTree = ""; }; + 9FBD962B08F2223EAE6B8C1B /* Frameworks */ = { + isa = PBXGroup; + children = ( + A320C0FBC18D5DB5A28E3BCE /* Pods_Runner.framework */, + 8D24D0DC777017FF334A92E3 /* Pods_RunnerTests.framework */, + ); + name = Frameworks; + sourceTree = ""; + }; + F571201148B6038FDD51D8B9 /* Pods */ = { + isa = PBXGroup; + children = ( + 9F0F12A21F633FC275B500CC /* Pods-Runner.debug.xcconfig */, + 149D1CDB4F00766B1154D9DB /* Pods-Runner.release.xcconfig */, + 8398D3525ED639A43CC83D65 /* Pods-Runner.profile.xcconfig */, + CBD25C8C9EC55AB9C6CEBC82 /* Pods-RunnerTests.debug.xcconfig */, + 7C97A2D8B3C68D5BE9CE38CC /* Pods-RunnerTests.release.xcconfig */, + 18FF06663DDCC3FE1AF52BBB /* Pods-RunnerTests.profile.xcconfig */, + ); + name = Pods; + path = Pods; + sourceTree = ""; + }; /* End PBXGroup section */ /* Begin PBXNativeTarget section */ @@ -128,8 +172,10 @@ isa = PBXNativeTarget; buildConfigurationList = 331C8087294A63A400263BE5 /* Build configuration list for PBXNativeTarget "RunnerTests" */; buildPhases = ( + 91CEE17D90716FD95C1BB14A /* [CP] Check Pods Manifest.lock */, 331C807D294A63A400263BE5 /* Sources */, 331C807F294A63A400263BE5 /* Resources */, + 0048844A594938344EF9EA7C /* Frameworks */, ); buildRules = ( ); @@ -145,12 +191,14 @@ isa = PBXNativeTarget; buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */; buildPhases = ( + D86F47D09AFACFE7DE69C1D5 /* [CP] Check Pods Manifest.lock */, 9740EEB61CF901F6004384FC /* Run Script */, 97C146EA1CF9000F007C117D /* Sources */, 97C146EB1CF9000F007C117D /* Frameworks */, 97C146EC1CF9000F007C117D /* Resources */, 9705A1C41CF9048500538489 /* Embed Frameworks */, 3B06AD1E1E4923F5004D2608 /* Thin Binary */, + FD299E0EEE0BEA2B423E7B8A /* [CP] Embed Pods Frameworks */, ); buildRules = ( ); @@ -238,6 +286,28 @@ shellPath = /bin/sh; shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin"; }; + 91CEE17D90716FD95C1BB14A /* [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-RunnerTests-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; + }; 9740EEB61CF901F6004384FC /* Run Script */ = { isa = PBXShellScriptBuildPhase; alwaysOutOfDate = 1; @@ -253,6 +323,45 @@ shellPath = /bin/sh; shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build"; }; + D86F47D09AFACFE7DE69C1D5 /* [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-Runner-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; + }; + FD299E0EEE0BEA2B423E7B8A /* [CP] Embed Pods Frameworks */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-input-files.xcfilelist", + ); + name = "[CP] Embed Pods Frameworks"; + outputFileListPaths = ( + "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-output-files.xcfilelist", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n"; + showEnvVarsInLog = 0; + }; /* End PBXShellScriptBuildPhase section */ /* Begin PBXSourcesBuildPhase section */ @@ -346,7 +455,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 12.0; + IPHONEOS_DEPLOYMENT_TARGET = 13.0; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; SUPPORTED_PLATFORMS = iphoneos; @@ -378,6 +487,7 @@ }; 331C8088294A63A400263BE5 /* Debug */ = { isa = XCBuildConfiguration; + baseConfigurationReference = CBD25C8C9EC55AB9C6CEBC82 /* Pods-RunnerTests.debug.xcconfig */; buildSettings = { BUNDLE_LOADER = "$(TEST_HOST)"; CODE_SIGN_STYLE = Automatic; @@ -395,6 +505,7 @@ }; 331C8089294A63A400263BE5 /* Release */ = { isa = XCBuildConfiguration; + baseConfigurationReference = 7C97A2D8B3C68D5BE9CE38CC /* Pods-RunnerTests.release.xcconfig */; buildSettings = { BUNDLE_LOADER = "$(TEST_HOST)"; CODE_SIGN_STYLE = Automatic; @@ -410,6 +521,7 @@ }; 331C808A294A63A400263BE5 /* Profile */ = { isa = XCBuildConfiguration; + baseConfigurationReference = 18FF06663DDCC3FE1AF52BBB /* Pods-RunnerTests.profile.xcconfig */; buildSettings = { BUNDLE_LOADER = "$(TEST_HOST)"; CODE_SIGN_STYLE = Automatic; @@ -472,7 +584,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 12.0; + IPHONEOS_DEPLOYMENT_TARGET = 13.0; MTL_ENABLE_DEBUG_INFO = YES; ONLY_ACTIVE_ARCH = YES; SDKROOT = iphoneos; @@ -523,7 +635,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 12.0; + IPHONEOS_DEPLOYMENT_TARGET = 13.0; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; SUPPORTED_PLATFORMS = iphoneos; diff --git a/packages/flutter_client_sdk/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/packages/flutter_client_sdk/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme index 8e3ca5df..e3773d42 100644 --- a/packages/flutter_client_sdk/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme +++ b/packages/flutter_client_sdk/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme @@ -26,6 +26,7 @@ buildConfiguration = "Debug" selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" + customLLDBInitFile = "$(SRCROOT)/Flutter/ephemeral/flutter_lldbinit" shouldUseLaunchSchemeArgsEnv = "YES"> diff --git a/packages/flutter_client_sdk/example/ios/Runner.xcworkspace/contents.xcworkspacedata b/packages/flutter_client_sdk/example/ios/Runner.xcworkspace/contents.xcworkspacedata index 1d526a16..21a3cc14 100644 --- a/packages/flutter_client_sdk/example/ios/Runner.xcworkspace/contents.xcworkspacedata +++ b/packages/flutter_client_sdk/example/ios/Runner.xcworkspace/contents.xcworkspacedata @@ -4,4 +4,7 @@ + + diff --git a/packages/flutter_client_sdk/example/ios/Runner/AppDelegate.swift b/packages/flutter_client_sdk/example/ios/Runner/AppDelegate.swift index 9074fee9..c30b367e 100644 --- a/packages/flutter_client_sdk/example/ios/Runner/AppDelegate.swift +++ b/packages/flutter_client_sdk/example/ios/Runner/AppDelegate.swift @@ -1,13 +1,16 @@ import Flutter import UIKit -@UIApplicationMain -@objc class AppDelegate: FlutterAppDelegate { +@main +@objc class AppDelegate: FlutterAppDelegate, FlutterImplicitEngineDelegate { override func application( _ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? ) -> Bool { - GeneratedPluginRegistrant.register(with: self) return super.application(application, didFinishLaunchingWithOptions: launchOptions) } + + func didInitializeImplicitFlutterEngine(_ engineBridge: FlutterImplicitEngineBridge) { + GeneratedPluginRegistrant.register(with: engineBridge.pluginRegistry) + } } diff --git a/packages/flutter_client_sdk/example/ios/Runner/Info.plist b/packages/flutter_client_sdk/example/ios/Runner/Info.plist index 5458fc41..3ef4d0d3 100644 --- a/packages/flutter_client_sdk/example/ios/Runner/Info.plist +++ b/packages/flutter_client_sdk/example/ios/Runner/Info.plist @@ -2,6 +2,8 @@ + CADisableMinimumFrameDurationOnPhone + CFBundleDevelopmentRegion $(DEVELOPMENT_LANGUAGE) CFBundleDisplayName @@ -24,6 +26,29 @@ $(FLUTTER_BUILD_NUMBER) LSRequiresIPhoneOS + UIApplicationSceneManifest + + UIApplicationSupportsMultipleScenes + + UISceneConfigurations + + UIWindowSceneSessionRoleApplication + + + UISceneClassName + UIWindowScene + UISceneConfigurationName + flutter + UISceneDelegateClassName + FlutterSceneDelegate + UISceneStoryboardFile + Main + + + + + UIApplicationSupportsIndirectInputEvents + UILaunchStoryboardName LaunchScreen UIMainStoryboardFile @@ -41,9 +66,5 @@ UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight - CADisableMinimumFrameDurationOnPhone - - UIApplicationSupportsIndirectInputEvents - diff --git a/packages/flutter_client_sdk/example/macos/Flutter/Flutter-Debug.xcconfig b/packages/flutter_client_sdk/example/macos/Flutter/Flutter-Debug.xcconfig index c2efd0b6..4b81f9b2 100644 --- a/packages/flutter_client_sdk/example/macos/Flutter/Flutter-Debug.xcconfig +++ b/packages/flutter_client_sdk/example/macos/Flutter/Flutter-Debug.xcconfig @@ -1 +1,2 @@ +#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig" #include "ephemeral/Flutter-Generated.xcconfig" diff --git a/packages/flutter_client_sdk/example/macos/Flutter/Flutter-Release.xcconfig b/packages/flutter_client_sdk/example/macos/Flutter/Flutter-Release.xcconfig index c2efd0b6..5caa9d15 100644 --- a/packages/flutter_client_sdk/example/macos/Flutter/Flutter-Release.xcconfig +++ b/packages/flutter_client_sdk/example/macos/Flutter/Flutter-Release.xcconfig @@ -1 +1,2 @@ +#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig" #include "ephemeral/Flutter-Generated.xcconfig" diff --git a/packages/flutter_client_sdk/example/macos/Podfile b/packages/flutter_client_sdk/example/macos/Podfile new file mode 100644 index 00000000..ff5ddb3b --- /dev/null +++ b/packages/flutter_client_sdk/example/macos/Podfile @@ -0,0 +1,42 @@ +platform :osx, '10.15' + +# CocoaPods analytics sends network stats synchronously affecting flutter build latency. +ENV['COCOAPODS_DISABLE_STATS'] = 'true' + +project 'Runner', { + 'Debug' => :debug, + 'Profile' => :release, + 'Release' => :release, +} + +def flutter_root + generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'ephemeral', 'Flutter-Generated.xcconfig'), __FILE__) + unless File.exist?(generated_xcode_build_settings_path) + raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure \"flutter pub get\" is executed first" + end + + File.foreach(generated_xcode_build_settings_path) do |line| + matches = line.match(/FLUTTER_ROOT\=(.*)/) + return matches[1].strip if matches + end + raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Flutter-Generated.xcconfig, then run \"flutter pub get\"" +end + +require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root) + +flutter_macos_podfile_setup + +target 'Runner' do + use_frameworks! + + flutter_install_all_macos_pods File.dirname(File.realpath(__FILE__)) + target 'RunnerTests' do + inherit! :search_paths + end +end + +post_install do |installer| + installer.pods_project.targets.each do |target| + flutter_additional_macos_build_settings(target) + end +end diff --git a/packages/flutter_client_sdk/lib/src/ld_client.dart b/packages/flutter_client_sdk/lib/src/ld_client.dart index ecaa3f47..cda2aa68 100644 --- a/packages/flutter_client_sdk/lib/src/ld_client.dart +++ b/packages/flutter_client_sdk/lib/src/ld_client.dart @@ -6,6 +6,7 @@ import 'connection_manager.dart'; import 'flutter_state_detector.dart'; import 'persistence/shared_preferences_persistence.dart'; import 'platform_env_reporter.dart'; +import 'plugin.dart'; const sdkName = 'FlutterClientSdk'; const sdkVersion = '4.16.0'; // x-release-please-version @@ -38,6 +39,7 @@ const sdkVersion = '4.16.0'; // x-release-please-version interface class LDClient { late final LDCommonClient _client; late final ConnectionManager _connectionManager; + late final PluginEnvironmentMetadata _pluginEnvironmentMetadata; /// Stream which emits data source status changes. /// @@ -93,15 +95,14 @@ interface class LDClient { final sdkPluginMetadata = PluginSdkMetadata(name: sdkName, version: sdkVersion); + _pluginEnvironmentMetadata = PluginEnvironmentMetadata( + sdk: sdkPluginMetadata, + application: config.applicationInfo, + credential: PluginCredentialInfo( + type: _client.credentialType, value: config.sdkCredential)); + safeRegisterPlugins( - this, - PluginEnvironmentMetadata( - sdk: sdkPluginMetadata, - application: config.applicationInfo, - credential: PluginCredentialInfo( - type: _client.credentialType, value: config.sdkCredential)), - config.plugins, - config.logger); + this, _pluginEnvironmentMetadata, config.plugins, config.logger); } /// Initialize the SDK. @@ -358,4 +359,45 @@ interface class LDClient { void addHook(Hook hook) { _client.addHook(hook); } + + /// Registers a plugin with this SDK instance after the client has been + /// constructed. + /// + /// Bundled hooks from the plugin are added before [Plugin.register] is + /// invoked. If reading [Plugin.hooks] throws, the plugin is not registered. + /// If [Plugin.register] throws, the error is logged and not rethrown. + void registerPlugin(Plugin plugin) { + final hooks = _getRuntimePluginHooks(plugin); + if (hooks == null) { + return; + } + + for (final hook in hooks) { + addHook(hook); + } + + safeRegisterPlugins( + this, _pluginEnvironmentMetadata, [plugin], _client.logger); + } + + /// Returns plugin hooks for runtime registration, or `null` if retrieval failed. + List? _getRuntimePluginHooks(Plugin plugin) { + try { + return plugin.hooks; + } catch (err) { + _client.logger.warn( + 'Exception thrown getting hooks for plugin ${_safeGetPluginName(plugin)}. Unable to get hooks for plugin.'); + return null; + } + } + + String _safeGetPluginName(Plugin plugin) { + try { + return plugin.metadata.name; + } catch (err) { + _client.logger + .warn('Exception thrown access the name of a registered plugin.'); + return 'unknown'; + } + } } diff --git a/packages/flutter_client_sdk/test/ld_client_plugin_test.dart b/packages/flutter_client_sdk/test/ld_client_plugin_test.dart index 0cf7b619..965d9d6d 100644 --- a/packages/flutter_client_sdk/test/ld_client_plugin_test.dart +++ b/packages/flutter_client_sdk/test/ld_client_plugin_test.dart @@ -70,20 +70,27 @@ final class TestPlugin extends Plugin { final String pluginName; final List _hooks; final bool shouldThrowOnRegister; + final bool shouldThrowOnGetHooks; final PluginMetadata _metadata; int registerCallCount = 0; LDClient? lastClientReceived; PluginEnvironmentMetadata? lastEnvironmentMetadataReceived; - TestPlugin(this.pluginName, this._hooks, {this.shouldThrowOnRegister = false}) + TestPlugin(this.pluginName, this._hooks, + {this.shouldThrowOnRegister = false, this.shouldThrowOnGetHooks = false}) : _metadata = PluginMetadata(name: pluginName); @override PluginMetadata get metadata => _metadata; @override - List get hooks => _hooks; + List get hooks { + if (shouldThrowOnGetHooks) { + throw Exception('Test exception from plugin $pluginName'); + } + return _hooks; + } @override void register( @@ -99,6 +106,29 @@ final class TestPlugin extends Plugin { } } +final class EvaluationOnRegisterPlugin extends Plugin { + final TestHook hook; + final PluginMetadata _metadata; + + int registerCallCount = 0; + + EvaluationOnRegisterPlugin(this.hook) + : _metadata = PluginMetadata(name: 'evaluation-on-register-plugin'); + + @override + PluginMetadata get metadata => _metadata; + + @override + List get hooks => [hook]; + + @override + void register( + LDClient client, PluginEnvironmentMetadata environmentMetadata) { + registerCallCount++; + client.boolVariation('test-flag', false); + } +} + final class _WifiConnected extends ConnectivityPlatform { final StreamController> _controller = StreamController(); @@ -393,4 +423,79 @@ void main() { client.close(); }); }); + + group('LDClient registerPlugin', () { + test('registers plugin with environment metadata', () { + final plugin = TestPlugin('runtime-plugin', []); + final client = createTestClient(); + + client.registerPlugin(plugin); + + expect(plugin.registerCallCount, equals(1)); + expect(plugin.lastClientReceived, same(client)); + expect(plugin.lastEnvironmentMetadataReceived, isNotNull); + expect(plugin.lastEnvironmentMetadataReceived!.sdk.name, + equals('FlutterClientSdk')); + expect(plugin.lastEnvironmentMetadataReceived!.credential.value, + equals('test-mobile-key')); + + client.close(); + }); + + test('activates bundled hooks after registerPlugin', () { + final hook = TestHook('runtime-plugin-hook'); + final plugin = TestPlugin('runtime-plugin', [hook]); + final client = createTestClient(); + + client.registerPlugin(plugin); + hook.callLog.clear(); + client.boolVariation('test-flag', false); + + expect(hook.callLog.any((call) => call.startsWith('beforeEvaluation')), + isTrue); + expect(hook.callLog.any((call) => call.startsWith('afterEvaluation')), + isTrue); + + client.close(); + }); + + test('adds hooks before plugin register is invoked', () { + final hook = TestHook('runtime-order-hook'); + final plugin = EvaluationOnRegisterPlugin(hook); + final client = createTestClient(); + + client.registerPlugin(plugin); + + expect(plugin.registerCallCount, equals(1)); + expect(hook.callLog.any((call) => call.startsWith('beforeEvaluation')), + isTrue); + expect(hook.callLog.any((call) => call.startsWith('afterEvaluation')), + isTrue); + + client.close(); + }); + + test('does not register plugin when hooks getter throws', () { + final plugin = TestPlugin('bad-hooks-plugin', [], + shouldThrowOnGetHooks: true); + final client = createTestClient(); + + client.registerPlugin(plugin); + + expect(plugin.registerCallCount, equals(0)); + + client.close(); + }); + + test('does not throw when plugin register throws', () { + final plugin = + TestPlugin('bad-register-plugin', [], shouldThrowOnRegister: true); + final client = createTestClient(); + + expect(() => client.registerPlugin(plugin), returnsNormally); + expect(plugin.registerCallCount, equals(1)); + + client.close(); + }); + }); } From 31d2e4ff4a306d518dce86d6df65c44f5a741731 Mon Sep 17 00:00:00 2001 From: Andrey Belonogov Date: Thu, 28 May 2026 16:59:20 -0700 Subject: [PATCH 2/8] reuse function --- .../lib/launchdarkly_common_client.dart | 3 ++- packages/flutter_client_sdk/lib/src/ld_client.dart | 12 +----------- 2 files changed, 3 insertions(+), 12 deletions(-) diff --git a/packages/common_client/lib/launchdarkly_common_client.dart b/packages/common_client/lib/launchdarkly_common_client.dart index ddc62c19..872ec890 100644 --- a/packages/common_client/lib/launchdarkly_common_client.dart +++ b/packages/common_client/lib/launchdarkly_common_client.dart @@ -70,6 +70,7 @@ export 'src/plugins/plugin.dart' PluginMetadata, PluginSdkMetadata; -export 'src/plugins/operations.dart' show safeGetHooks, safeRegisterPlugins; +export 'src/plugins/operations.dart' + show safeGetHooks, safeGetPluginName, safeRegisterPlugins; export 'src/config/defaults/credential_type.dart' show CredentialType; diff --git a/packages/flutter_client_sdk/lib/src/ld_client.dart b/packages/flutter_client_sdk/lib/src/ld_client.dart index cda2aa68..0ffc5a20 100644 --- a/packages/flutter_client_sdk/lib/src/ld_client.dart +++ b/packages/flutter_client_sdk/lib/src/ld_client.dart @@ -386,18 +386,8 @@ interface class LDClient { return plugin.hooks; } catch (err) { _client.logger.warn( - 'Exception thrown getting hooks for plugin ${_safeGetPluginName(plugin)}. Unable to get hooks for plugin.'); + 'Exception thrown getting hooks for plugin ${safeGetPluginName(plugin, _client.logger)}. Unable to get hooks for plugin.'); return null; } } - - String _safeGetPluginName(Plugin plugin) { - try { - return plugin.metadata.name; - } catch (err) { - _client.logger - .warn('Exception thrown access the name of a registered plugin.'); - return 'unknown'; - } - } } From 6232b58b6011091b86adf6dc5165b95a24bec9fe Mon Sep 17 00:00:00 2001 From: Andrey Belonogov Date: Thu, 28 May 2026 17:06:02 -0700 Subject: [PATCH 3/8] fix formatting --- packages/flutter_client_sdk/test/ld_client_plugin_test.dart | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/flutter_client_sdk/test/ld_client_plugin_test.dart b/packages/flutter_client_sdk/test/ld_client_plugin_test.dart index 965d9d6d..9b74a40a 100644 --- a/packages/flutter_client_sdk/test/ld_client_plugin_test.dart +++ b/packages/flutter_client_sdk/test/ld_client_plugin_test.dart @@ -476,8 +476,8 @@ void main() { }); test('does not register plugin when hooks getter throws', () { - final plugin = TestPlugin('bad-hooks-plugin', [], - shouldThrowOnGetHooks: true); + final plugin = + TestPlugin('bad-hooks-plugin', [], shouldThrowOnGetHooks: true); final client = createTestClient(); client.registerPlugin(plugin); From 4902c30f9a902f391de5557ea5977eed4d650d4c Mon Sep 17 00:00:00 2001 From: Andrey Belonogov Date: Fri, 29 May 2026 13:51:27 -0700 Subject: [PATCH 4/8] address feadback --- .../lib/launchdarkly_common_client.dart | 2 +- .../lib/src/plugins/operations.dart | 24 ++++++++++++------- .../flutter_client_sdk/lib/src/ld_client.dart | 13 +--------- 3 files changed, 17 insertions(+), 22 deletions(-) diff --git a/packages/common_client/lib/launchdarkly_common_client.dart b/packages/common_client/lib/launchdarkly_common_client.dart index 07ee9169..ea2d2202 100644 --- a/packages/common_client/lib/launchdarkly_common_client.dart +++ b/packages/common_client/lib/launchdarkly_common_client.dart @@ -97,6 +97,6 @@ export 'src/plugins/plugin.dart' PluginSdkMetadata; export 'src/plugins/operations.dart' - show safeGetHooks, safeGetPluginName, safeRegisterPlugins; + show safeGetHooks, safeGetPluginHooks, safeGetPluginName, safeRegisterPlugins; export 'src/config/defaults/credential_type.dart' show CredentialType; diff --git a/packages/common_client/lib/src/plugins/operations.dart b/packages/common_client/lib/src/plugins/operations.dart index 5717dcc7..8118b0e0 100644 --- a/packages/common_client/lib/src/plugins/operations.dart +++ b/packages/common_client/lib/src/plugins/operations.dart @@ -15,20 +15,26 @@ String safeGetPluginName(PluginBase plugin, LDLogger logger) { } } +/// Returns the hooks for a single [plugin], or `null` if reading +/// [PluginBase.hooks] throws. +List? safeGetPluginHooks( + PluginBase plugin, LDLogger logger) { + try { + return plugin.hooks; + } catch (err) { + logger.warn( + 'Exception thrown getting hooks for plugin ${safeGetPluginName(plugin, logger)}. Unable to get hooks for plugin.'); + return null; + } +} + List? safeGetHooks( List>? plugins, LDLogger logger) { if (plugins == null) return null; return plugins - .map>((plugin) { - try { - return plugin.hooks; - } catch (err) { - logger.warn( - 'Exception thrown getting hooks for plugin ${safeGetPluginName(plugin, logger)}. Unable to get hooks for plugin.'); - } - return []; - }) + .map>( + (plugin) => safeGetPluginHooks(plugin, logger) ?? []) .expand((hooks) => hooks) .toList(); } diff --git a/packages/flutter_client_sdk/lib/src/ld_client.dart b/packages/flutter_client_sdk/lib/src/ld_client.dart index 0ffc5a20..0a13871b 100644 --- a/packages/flutter_client_sdk/lib/src/ld_client.dart +++ b/packages/flutter_client_sdk/lib/src/ld_client.dart @@ -367,7 +367,7 @@ interface class LDClient { /// invoked. If reading [Plugin.hooks] throws, the plugin is not registered. /// If [Plugin.register] throws, the error is logged and not rethrown. void registerPlugin(Plugin plugin) { - final hooks = _getRuntimePluginHooks(plugin); + final hooks = safeGetPluginHooks(plugin, _client.logger); if (hooks == null) { return; } @@ -379,15 +379,4 @@ interface class LDClient { safeRegisterPlugins( this, _pluginEnvironmentMetadata, [plugin], _client.logger); } - - /// Returns plugin hooks for runtime registration, or `null` if retrieval failed. - List? _getRuntimePluginHooks(Plugin plugin) { - try { - return plugin.hooks; - } catch (err) { - _client.logger.warn( - 'Exception thrown getting hooks for plugin ${safeGetPluginName(plugin, _client.logger)}. Unable to get hooks for plugin.'); - return null; - } - } } From ad243333a16149b0134fe9ba3896e3325672bc8a Mon Sep 17 00:00:00 2001 From: Andrey Belonogov Date: Fri, 29 May 2026 13:55:07 -0700 Subject: [PATCH 5/8] refactor: extract safeGetPluginHooks helper in common_client Add safeGetPluginHooks to handle a single plugin and return null on error, and reuse it within safeGetHooks. Export the new helper (and safeGetPluginName) from the package barrel file. Co-authored-by: Cursor --- .../lib/launchdarkly_common_client.dart | 3 ++- .../lib/src/plugins/operations.dart | 24 ++++++++++++------- 2 files changed, 17 insertions(+), 10 deletions(-) diff --git a/packages/common_client/lib/launchdarkly_common_client.dart b/packages/common_client/lib/launchdarkly_common_client.dart index 3bd6cbbe..ea2d2202 100644 --- a/packages/common_client/lib/launchdarkly_common_client.dart +++ b/packages/common_client/lib/launchdarkly_common_client.dart @@ -96,6 +96,7 @@ export 'src/plugins/plugin.dart' PluginMetadata, PluginSdkMetadata; -export 'src/plugins/operations.dart' show safeGetHooks, safeRegisterPlugins; +export 'src/plugins/operations.dart' + show safeGetHooks, safeGetPluginHooks, safeGetPluginName, safeRegisterPlugins; export 'src/config/defaults/credential_type.dart' show CredentialType; diff --git a/packages/common_client/lib/src/plugins/operations.dart b/packages/common_client/lib/src/plugins/operations.dart index 5717dcc7..8118b0e0 100644 --- a/packages/common_client/lib/src/plugins/operations.dart +++ b/packages/common_client/lib/src/plugins/operations.dart @@ -15,20 +15,26 @@ String safeGetPluginName(PluginBase plugin, LDLogger logger) { } } +/// Returns the hooks for a single [plugin], or `null` if reading +/// [PluginBase.hooks] throws. +List? safeGetPluginHooks( + PluginBase plugin, LDLogger logger) { + try { + return plugin.hooks; + } catch (err) { + logger.warn( + 'Exception thrown getting hooks for plugin ${safeGetPluginName(plugin, logger)}. Unable to get hooks for plugin.'); + return null; + } +} + List? safeGetHooks( List>? plugins, LDLogger logger) { if (plugins == null) return null; return plugins - .map>((plugin) { - try { - return plugin.hooks; - } catch (err) { - logger.warn( - 'Exception thrown getting hooks for plugin ${safeGetPluginName(plugin, logger)}. Unable to get hooks for plugin.'); - } - return []; - }) + .map>( + (plugin) => safeGetPluginHooks(plugin, logger) ?? []) .expand((hooks) => hooks) .toList(); } From f537962f9f85bd106e229ab727f5d6f2f8101eec Mon Sep 17 00:00:00 2001 From: Andrey Belonogov Date: Fri, 29 May 2026 14:01:20 -0700 Subject: [PATCH 6/8] chore: apply dart format Co-authored-by: Cursor --- packages/common_client/lib/launchdarkly_common_client.dart | 6 +++++- packages/common_client/lib/src/plugins/operations.dart | 3 +-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/packages/common_client/lib/launchdarkly_common_client.dart b/packages/common_client/lib/launchdarkly_common_client.dart index ea2d2202..5f71cb84 100644 --- a/packages/common_client/lib/launchdarkly_common_client.dart +++ b/packages/common_client/lib/launchdarkly_common_client.dart @@ -97,6 +97,10 @@ export 'src/plugins/plugin.dart' PluginSdkMetadata; export 'src/plugins/operations.dart' - show safeGetHooks, safeGetPluginHooks, safeGetPluginName, safeRegisterPlugins; + show + safeGetHooks, + safeGetPluginHooks, + safeGetPluginName, + safeRegisterPlugins; export 'src/config/defaults/credential_type.dart' show CredentialType; diff --git a/packages/common_client/lib/src/plugins/operations.dart b/packages/common_client/lib/src/plugins/operations.dart index 8118b0e0..45f32d90 100644 --- a/packages/common_client/lib/src/plugins/operations.dart +++ b/packages/common_client/lib/src/plugins/operations.dart @@ -33,8 +33,7 @@ List? safeGetHooks( if (plugins == null) return null; return plugins - .map>( - (plugin) => safeGetPluginHooks(plugin, logger) ?? []) + .map>((plugin) => safeGetPluginHooks(plugin, logger) ?? []) .expand((hooks) => hooks) .toList(); } From 96732f164a85db737aa396c52d785c9ec1c93b68 Mon Sep 17 00:00:00 2001 From: Andrey Belonogov Date: Fri, 29 May 2026 14:42:01 -0700 Subject: [PATCH 7/8] chore: bump launchdarkly_common_client to 1.10.0 Co-authored-by: Cursor --- .../pubspec.lock | 12 ++++++------ packages/flutter_client_sdk/pubspec.yaml | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/apps/flutter_client_contract_test_service/pubspec.lock b/apps/flutter_client_contract_test_service/pubspec.lock index 7e87ead5..6a71a8d7 100644 --- a/apps/flutter_client_contract_test_service/pubspec.lock +++ b/apps/flutter_client_contract_test_service/pubspec.lock @@ -391,26 +391,26 @@ packages: dependency: transitive description: name: launchdarkly_common_client - sha256: "02afb127aec6a5e9238005db02cb377ead5902d30207ef58ae8d4afe06aeae63" + sha256: aeefe7bc4b7bf995fa23a5165846a7320aa1eaa48089f19d150a0144fbf5bfad url: "https://pub.dev" source: hosted - version: "1.9.0" + version: "1.10.0" launchdarkly_dart_common: dependency: transitive description: name: launchdarkly_dart_common - sha256: c25991ffc1ab2c951e31047955448970628c1c2dd09b1197bc527dc7dcdf2595 + sha256: e36fb8d943ea7a5b99e7ecdc361174ca95e05533904dd92175816ae5c9723eee url: "https://pub.dev" source: hosted - version: "1.8.0" + version: "1.8.1" launchdarkly_event_source_client: dependency: transitive description: name: launchdarkly_event_source_client - sha256: "51c90efe9765bf6908772abd59ea16c193798c1a9f9381475c56299cb553e3b2" + sha256: c248a81bc353d44f7f18803ff625d784d640265bf8bbc32c63f1d2d91911b88f url: "https://pub.dev" source: hosted - version: "2.0.1" + version: "2.1.0" launchdarkly_flutter_client_sdk: dependency: "direct main" description: diff --git a/packages/flutter_client_sdk/pubspec.yaml b/packages/flutter_client_sdk/pubspec.yaml index 7354b7e6..7d1e8f7b 100644 --- a/packages/flutter_client_sdk/pubspec.yaml +++ b/packages/flutter_client_sdk/pubspec.yaml @@ -13,7 +13,7 @@ dependencies: sdk: flutter package_info_plus: ">=4.2.0 <11.0.0" device_info_plus: ">=9.1.1 <14.0.0" - launchdarkly_common_client: 1.9.0 + launchdarkly_common_client: 1.10.0 shared_preferences: ^2.2.2 connectivity_plus: ">=5.0.2 <8.0.0" web: ^1.1.1 From c815251ba62a9bba334e13d4481ef704218dbaca Mon Sep 17 00:00:00 2001 From: Andrey Belonogov Date: Fri, 29 May 2026 14:58:25 -0700 Subject: [PATCH 8/8] chore: revert iOS/macOS example artifacts and gitignore Podfiles Roll back the CocoaPods integration and Flutter-migration changes that leaked in from running the example on iOS/macOS locally, and ignore the regenerated Podfile/Podfile.lock so they are not committed again. Co-authored-by: Cursor --- .../flutter_client_sdk/example/.gitignore | 2 - .../flutter_client_sdk/example/ios/.gitignore | 3 + .../ios/Flutter/AppFrameworkInfo.plist | 2 + .../example/ios/Flutter/Debug.xcconfig | 1 - .../example/ios/Flutter/Release.xcconfig | 1 - .../flutter_client_sdk/example/ios/Podfile | 43 ------- .../example/ios/Podfile.lock | 41 ------ .../ios/Runner.xcodeproj/project.pbxproj | 118 +----------------- .../xcshareddata/xcschemes/Runner.xcscheme | 3 - .../contents.xcworkspacedata | 3 - .../example/ios/Runner/AppDelegate.swift | 9 +- .../example/ios/Runner/Info.plist | 29 +---- .../example/macos/.gitignore | 4 + .../macos/Flutter/Flutter-Debug.xcconfig | 1 - .../macos/Flutter/Flutter-Release.xcconfig | 1 - .../flutter_client_sdk/example/macos/Podfile | 42 ------- 16 files changed, 19 insertions(+), 284 deletions(-) delete mode 100644 packages/flutter_client_sdk/example/ios/Podfile delete mode 100644 packages/flutter_client_sdk/example/ios/Podfile.lock delete mode 100644 packages/flutter_client_sdk/example/macos/Podfile diff --git a/packages/flutter_client_sdk/example/.gitignore b/packages/flutter_client_sdk/example/.gitignore index 79c113f9..29a3a501 100644 --- a/packages/flutter_client_sdk/example/.gitignore +++ b/packages/flutter_client_sdk/example/.gitignore @@ -5,11 +5,9 @@ *.swp .DS_Store .atom/ -.build/ .buildlog/ .history .svn/ -.swiftpm/ migrate_working_dir/ # IntelliJ related diff --git a/packages/flutter_client_sdk/example/ios/.gitignore b/packages/flutter_client_sdk/example/ios/.gitignore index 7a7f9873..b33aacc0 100644 --- a/packages/flutter_client_sdk/example/ios/.gitignore +++ b/packages/flutter_client_sdk/example/ios/.gitignore @@ -1,4 +1,7 @@ **/dgph +# CocoaPods (regenerated by `flutter run`/`pod install`) +Podfile +Podfile.lock *.mode1v3 *.mode2v3 *.moved-aside diff --git a/packages/flutter_client_sdk/example/ios/Flutter/AppFrameworkInfo.plist b/packages/flutter_client_sdk/example/ios/Flutter/AppFrameworkInfo.plist index 391a902b..7c569640 100644 --- a/packages/flutter_client_sdk/example/ios/Flutter/AppFrameworkInfo.plist +++ b/packages/flutter_client_sdk/example/ios/Flutter/AppFrameworkInfo.plist @@ -20,5 +20,7 @@ ???? CFBundleVersion 1.0 + MinimumOSVersion + 12.0 diff --git a/packages/flutter_client_sdk/example/ios/Flutter/Debug.xcconfig b/packages/flutter_client_sdk/example/ios/Flutter/Debug.xcconfig index ec97fc6f..592ceee8 100644 --- a/packages/flutter_client_sdk/example/ios/Flutter/Debug.xcconfig +++ b/packages/flutter_client_sdk/example/ios/Flutter/Debug.xcconfig @@ -1,2 +1 @@ -#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig" #include "Generated.xcconfig" diff --git a/packages/flutter_client_sdk/example/ios/Flutter/Release.xcconfig b/packages/flutter_client_sdk/example/ios/Flutter/Release.xcconfig index c4855bfe..592ceee8 100644 --- a/packages/flutter_client_sdk/example/ios/Flutter/Release.xcconfig +++ b/packages/flutter_client_sdk/example/ios/Flutter/Release.xcconfig @@ -1,2 +1 @@ -#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig" #include "Generated.xcconfig" diff --git a/packages/flutter_client_sdk/example/ios/Podfile b/packages/flutter_client_sdk/example/ios/Podfile deleted file mode 100644 index 620e46eb..00000000 --- a/packages/flutter_client_sdk/example/ios/Podfile +++ /dev/null @@ -1,43 +0,0 @@ -# Uncomment this line to define a global platform for your project -# platform :ios, '13.0' - -# CocoaPods analytics sends network stats synchronously affecting flutter build latency. -ENV['COCOAPODS_DISABLE_STATS'] = 'true' - -project 'Runner', { - 'Debug' => :debug, - 'Profile' => :release, - 'Release' => :release, -} - -def flutter_root - generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'Generated.xcconfig'), __FILE__) - unless File.exist?(generated_xcode_build_settings_path) - raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure flutter pub get is executed first" - end - - File.foreach(generated_xcode_build_settings_path) do |line| - matches = line.match(/FLUTTER_ROOT\=(.*)/) - return matches[1].strip if matches - end - raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Generated.xcconfig, then run flutter pub get" -end - -require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root) - -flutter_ios_podfile_setup - -target 'Runner' do - use_frameworks! - - flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__)) - target 'RunnerTests' do - inherit! :search_paths - end -end - -post_install do |installer| - installer.pods_project.targets.each do |target| - flutter_additional_ios_build_settings(target) - end -end diff --git a/packages/flutter_client_sdk/example/ios/Podfile.lock b/packages/flutter_client_sdk/example/ios/Podfile.lock deleted file mode 100644 index b3217812..00000000 --- a/packages/flutter_client_sdk/example/ios/Podfile.lock +++ /dev/null @@ -1,41 +0,0 @@ -PODS: - - connectivity_plus (0.0.1): - - Flutter - - device_info_plus (0.0.1): - - Flutter - - Flutter (1.0.0) - - package_info_plus (0.4.5): - - Flutter - - shared_preferences_foundation (0.0.1): - - Flutter - - FlutterMacOS - -DEPENDENCIES: - - connectivity_plus (from `.symlinks/plugins/connectivity_plus/ios`) - - device_info_plus (from `.symlinks/plugins/device_info_plus/ios`) - - Flutter (from `Flutter`) - - package_info_plus (from `.symlinks/plugins/package_info_plus/ios`) - - shared_preferences_foundation (from `.symlinks/plugins/shared_preferences_foundation/darwin`) - -EXTERNAL SOURCES: - connectivity_plus: - :path: ".symlinks/plugins/connectivity_plus/ios" - device_info_plus: - :path: ".symlinks/plugins/device_info_plus/ios" - Flutter: - :path: Flutter - package_info_plus: - :path: ".symlinks/plugins/package_info_plus/ios" - shared_preferences_foundation: - :path: ".symlinks/plugins/shared_preferences_foundation/darwin" - -SPEC CHECKSUMS: - connectivity_plus: cb623214f4e1f6ef8fe7403d580fdad517d2f7dd - device_info_plus: 21fcca2080fbcd348be798aa36c3e5ed849eefbe - Flutter: cabc95a1d2626b1b06e7179b784ebcf0c0cde467 - package_info_plus: af8e2ca6888548050f16fa2f1938db7b5a5df499 - shared_preferences_foundation: 7036424c3d8ec98dfe75ff1667cb0cd531ec82bb - -PODFILE CHECKSUM: 3c63482e143d1b91d2d2560aee9fb04ecc74ac7e - -COCOAPODS: 1.16.2 diff --git a/packages/flutter_client_sdk/example/ios/Runner.xcodeproj/project.pbxproj b/packages/flutter_client_sdk/example/ios/Runner.xcodeproj/project.pbxproj index 52f702bc..ce3bc8fc 100644 --- a/packages/flutter_client_sdk/example/ios/Runner.xcodeproj/project.pbxproj +++ b/packages/flutter_client_sdk/example/ios/Runner.xcodeproj/project.pbxproj @@ -10,12 +10,10 @@ 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; }; 331C808B294A63AB00263BE5 /* RunnerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 331C807B294A618700263BE5 /* RunnerTests.swift */; }; 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; }; - 4D12F76F78DAD09E3C83B7EB /* Pods_RunnerTests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8D24D0DC777017FF334A92E3 /* Pods_RunnerTests.framework */; }; 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; }; 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; }; 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; }; 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; }; - DE290C876972375F3CB7FE08 /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A320C0FBC18D5DB5A28E3BCE /* Pods_Runner.framework */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ @@ -44,17 +42,12 @@ /* Begin PBXFileReference section */ 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = ""; }; 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = ""; }; - 149D1CDB4F00766B1154D9DB /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = ""; }; - 18FF06663DDCC3FE1AF52BBB /* Pods-RunnerTests.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RunnerTests.profile.xcconfig"; path = "Target Support Files/Pods-RunnerTests/Pods-RunnerTests.profile.xcconfig"; sourceTree = ""; }; 331C807B294A618700263BE5 /* RunnerTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RunnerTests.swift; sourceTree = ""; }; 331C8081294A63A400263BE5 /* RunnerTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = RunnerTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = ""; }; 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = ""; }; 74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = ""; }; - 7C97A2D8B3C68D5BE9CE38CC /* Pods-RunnerTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RunnerTests.release.xcconfig"; path = "Target Support Files/Pods-RunnerTests/Pods-RunnerTests.release.xcconfig"; sourceTree = ""; }; - 8398D3525ED639A43CC83D65 /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; sourceTree = ""; }; - 8D24D0DC777017FF334A92E3 /* Pods_RunnerTests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_RunnerTests.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = ""; }; 9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = ""; }; 97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; }; @@ -62,25 +55,13 @@ 97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - 9F0F12A21F633FC275B500CC /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = ""; }; - A320C0FBC18D5DB5A28E3BCE /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - CBD25C8C9EC55AB9C6CEBC82 /* Pods-RunnerTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RunnerTests.debug.xcconfig"; path = "Target Support Files/Pods-RunnerTests/Pods-RunnerTests.debug.xcconfig"; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ - 0048844A594938344EF9EA7C /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - 4D12F76F78DAD09E3C83B7EB /* Pods_RunnerTests.framework in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; 97C146EB1CF9000F007C117D /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - DE290C876972375F3CB7FE08 /* Pods_Runner.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -113,8 +94,6 @@ 97C146F01CF9000F007C117D /* Runner */, 97C146EF1CF9000F007C117D /* Products */, 331C8082294A63A400263BE5 /* RunnerTests */, - F571201148B6038FDD51D8B9 /* Pods */, - 9FBD962B08F2223EAE6B8C1B /* Frameworks */, ); sourceTree = ""; }; @@ -142,29 +121,6 @@ path = Runner; sourceTree = ""; }; - 9FBD962B08F2223EAE6B8C1B /* Frameworks */ = { - isa = PBXGroup; - children = ( - A320C0FBC18D5DB5A28E3BCE /* Pods_Runner.framework */, - 8D24D0DC777017FF334A92E3 /* Pods_RunnerTests.framework */, - ); - name = Frameworks; - sourceTree = ""; - }; - F571201148B6038FDD51D8B9 /* Pods */ = { - isa = PBXGroup; - children = ( - 9F0F12A21F633FC275B500CC /* Pods-Runner.debug.xcconfig */, - 149D1CDB4F00766B1154D9DB /* Pods-Runner.release.xcconfig */, - 8398D3525ED639A43CC83D65 /* Pods-Runner.profile.xcconfig */, - CBD25C8C9EC55AB9C6CEBC82 /* Pods-RunnerTests.debug.xcconfig */, - 7C97A2D8B3C68D5BE9CE38CC /* Pods-RunnerTests.release.xcconfig */, - 18FF06663DDCC3FE1AF52BBB /* Pods-RunnerTests.profile.xcconfig */, - ); - name = Pods; - path = Pods; - sourceTree = ""; - }; /* End PBXGroup section */ /* Begin PBXNativeTarget section */ @@ -172,10 +128,8 @@ isa = PBXNativeTarget; buildConfigurationList = 331C8087294A63A400263BE5 /* Build configuration list for PBXNativeTarget "RunnerTests" */; buildPhases = ( - 91CEE17D90716FD95C1BB14A /* [CP] Check Pods Manifest.lock */, 331C807D294A63A400263BE5 /* Sources */, 331C807F294A63A400263BE5 /* Resources */, - 0048844A594938344EF9EA7C /* Frameworks */, ); buildRules = ( ); @@ -191,14 +145,12 @@ isa = PBXNativeTarget; buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */; buildPhases = ( - D86F47D09AFACFE7DE69C1D5 /* [CP] Check Pods Manifest.lock */, 9740EEB61CF901F6004384FC /* Run Script */, 97C146EA1CF9000F007C117D /* Sources */, 97C146EB1CF9000F007C117D /* Frameworks */, 97C146EC1CF9000F007C117D /* Resources */, 9705A1C41CF9048500538489 /* Embed Frameworks */, 3B06AD1E1E4923F5004D2608 /* Thin Binary */, - FD299E0EEE0BEA2B423E7B8A /* [CP] Embed Pods Frameworks */, ); buildRules = ( ); @@ -286,28 +238,6 @@ shellPath = /bin/sh; shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin"; }; - 91CEE17D90716FD95C1BB14A /* [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-RunnerTests-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; - }; 9740EEB61CF901F6004384FC /* Run Script */ = { isa = PBXShellScriptBuildPhase; alwaysOutOfDate = 1; @@ -323,45 +253,6 @@ shellPath = /bin/sh; shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build"; }; - D86F47D09AFACFE7DE69C1D5 /* [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-Runner-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; - }; - FD299E0EEE0BEA2B423E7B8A /* [CP] Embed Pods Frameworks */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputFileListPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-input-files.xcfilelist", - ); - name = "[CP] Embed Pods Frameworks"; - outputFileListPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-output-files.xcfilelist", - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n"; - showEnvVarsInLog = 0; - }; /* End PBXShellScriptBuildPhase section */ /* Begin PBXSourcesBuildPhase section */ @@ -455,7 +346,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 13.0; + IPHONEOS_DEPLOYMENT_TARGET = 12.0; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; SUPPORTED_PLATFORMS = iphoneos; @@ -487,7 +378,6 @@ }; 331C8088294A63A400263BE5 /* Debug */ = { isa = XCBuildConfiguration; - baseConfigurationReference = CBD25C8C9EC55AB9C6CEBC82 /* Pods-RunnerTests.debug.xcconfig */; buildSettings = { BUNDLE_LOADER = "$(TEST_HOST)"; CODE_SIGN_STYLE = Automatic; @@ -505,7 +395,6 @@ }; 331C8089294A63A400263BE5 /* Release */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 7C97A2D8B3C68D5BE9CE38CC /* Pods-RunnerTests.release.xcconfig */; buildSettings = { BUNDLE_LOADER = "$(TEST_HOST)"; CODE_SIGN_STYLE = Automatic; @@ -521,7 +410,6 @@ }; 331C808A294A63A400263BE5 /* Profile */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 18FF06663DDCC3FE1AF52BBB /* Pods-RunnerTests.profile.xcconfig */; buildSettings = { BUNDLE_LOADER = "$(TEST_HOST)"; CODE_SIGN_STYLE = Automatic; @@ -584,7 +472,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 13.0; + IPHONEOS_DEPLOYMENT_TARGET = 12.0; MTL_ENABLE_DEBUG_INFO = YES; ONLY_ACTIVE_ARCH = YES; SDKROOT = iphoneos; @@ -635,7 +523,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 13.0; + IPHONEOS_DEPLOYMENT_TARGET = 12.0; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; SUPPORTED_PLATFORMS = iphoneos; diff --git a/packages/flutter_client_sdk/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/packages/flutter_client_sdk/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme index e3773d42..8e3ca5df 100644 --- a/packages/flutter_client_sdk/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme +++ b/packages/flutter_client_sdk/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme @@ -26,7 +26,6 @@ buildConfiguration = "Debug" selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" - customLLDBInitFile = "$(SRCROOT)/Flutter/ephemeral/flutter_lldbinit" shouldUseLaunchSchemeArgsEnv = "YES"> diff --git a/packages/flutter_client_sdk/example/ios/Runner.xcworkspace/contents.xcworkspacedata b/packages/flutter_client_sdk/example/ios/Runner.xcworkspace/contents.xcworkspacedata index 21a3cc14..1d526a16 100644 --- a/packages/flutter_client_sdk/example/ios/Runner.xcworkspace/contents.xcworkspacedata +++ b/packages/flutter_client_sdk/example/ios/Runner.xcworkspace/contents.xcworkspacedata @@ -4,7 +4,4 @@ - - diff --git a/packages/flutter_client_sdk/example/ios/Runner/AppDelegate.swift b/packages/flutter_client_sdk/example/ios/Runner/AppDelegate.swift index c30b367e..9074fee9 100644 --- a/packages/flutter_client_sdk/example/ios/Runner/AppDelegate.swift +++ b/packages/flutter_client_sdk/example/ios/Runner/AppDelegate.swift @@ -1,16 +1,13 @@ import Flutter import UIKit -@main -@objc class AppDelegate: FlutterAppDelegate, FlutterImplicitEngineDelegate { +@UIApplicationMain +@objc class AppDelegate: FlutterAppDelegate { override func application( _ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? ) -> Bool { + GeneratedPluginRegistrant.register(with: self) return super.application(application, didFinishLaunchingWithOptions: launchOptions) } - - func didInitializeImplicitFlutterEngine(_ engineBridge: FlutterImplicitEngineBridge) { - GeneratedPluginRegistrant.register(with: engineBridge.pluginRegistry) - } } diff --git a/packages/flutter_client_sdk/example/ios/Runner/Info.plist b/packages/flutter_client_sdk/example/ios/Runner/Info.plist index 3ef4d0d3..5458fc41 100644 --- a/packages/flutter_client_sdk/example/ios/Runner/Info.plist +++ b/packages/flutter_client_sdk/example/ios/Runner/Info.plist @@ -2,8 +2,6 @@ - CADisableMinimumFrameDurationOnPhone - CFBundleDevelopmentRegion $(DEVELOPMENT_LANGUAGE) CFBundleDisplayName @@ -26,29 +24,6 @@ $(FLUTTER_BUILD_NUMBER) LSRequiresIPhoneOS - UIApplicationSceneManifest - - UIApplicationSupportsMultipleScenes - - UISceneConfigurations - - UIWindowSceneSessionRoleApplication - - - UISceneClassName - UIWindowScene - UISceneConfigurationName - flutter - UISceneDelegateClassName - FlutterSceneDelegate - UISceneStoryboardFile - Main - - - - - UIApplicationSupportsIndirectInputEvents - UILaunchStoryboardName LaunchScreen UIMainStoryboardFile @@ -66,5 +41,9 @@ UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight + CADisableMinimumFrameDurationOnPhone + + UIApplicationSupportsIndirectInputEvents + diff --git a/packages/flutter_client_sdk/example/macos/.gitignore b/packages/flutter_client_sdk/example/macos/.gitignore index 746adbb6..d04ed895 100644 --- a/packages/flutter_client_sdk/example/macos/.gitignore +++ b/packages/flutter_client_sdk/example/macos/.gitignore @@ -2,6 +2,10 @@ **/Flutter/ephemeral/ **/Pods/ +# CocoaPods (regenerated by `flutter run`/`pod install`) +Podfile +Podfile.lock + # Xcode-related **/dgph **/xcuserdata/ diff --git a/packages/flutter_client_sdk/example/macos/Flutter/Flutter-Debug.xcconfig b/packages/flutter_client_sdk/example/macos/Flutter/Flutter-Debug.xcconfig index 4b81f9b2..c2efd0b6 100644 --- a/packages/flutter_client_sdk/example/macos/Flutter/Flutter-Debug.xcconfig +++ b/packages/flutter_client_sdk/example/macos/Flutter/Flutter-Debug.xcconfig @@ -1,2 +1 @@ -#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig" #include "ephemeral/Flutter-Generated.xcconfig" diff --git a/packages/flutter_client_sdk/example/macos/Flutter/Flutter-Release.xcconfig b/packages/flutter_client_sdk/example/macos/Flutter/Flutter-Release.xcconfig index 5caa9d15..c2efd0b6 100644 --- a/packages/flutter_client_sdk/example/macos/Flutter/Flutter-Release.xcconfig +++ b/packages/flutter_client_sdk/example/macos/Flutter/Flutter-Release.xcconfig @@ -1,2 +1 @@ -#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig" #include "ephemeral/Flutter-Generated.xcconfig" diff --git a/packages/flutter_client_sdk/example/macos/Podfile b/packages/flutter_client_sdk/example/macos/Podfile deleted file mode 100644 index ff5ddb3b..00000000 --- a/packages/flutter_client_sdk/example/macos/Podfile +++ /dev/null @@ -1,42 +0,0 @@ -platform :osx, '10.15' - -# CocoaPods analytics sends network stats synchronously affecting flutter build latency. -ENV['COCOAPODS_DISABLE_STATS'] = 'true' - -project 'Runner', { - 'Debug' => :debug, - 'Profile' => :release, - 'Release' => :release, -} - -def flutter_root - generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'ephemeral', 'Flutter-Generated.xcconfig'), __FILE__) - unless File.exist?(generated_xcode_build_settings_path) - raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure \"flutter pub get\" is executed first" - end - - File.foreach(generated_xcode_build_settings_path) do |line| - matches = line.match(/FLUTTER_ROOT\=(.*)/) - return matches[1].strip if matches - end - raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Flutter-Generated.xcconfig, then run \"flutter pub get\"" -end - -require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root) - -flutter_macos_podfile_setup - -target 'Runner' do - use_frameworks! - - flutter_install_all_macos_pods File.dirname(File.realpath(__FILE__)) - target 'RunnerTests' do - inherit! :search_paths - end -end - -post_install do |installer| - installer.pods_project.targets.each do |target| - flutter_additional_macos_build_settings(target) - end -end