From 733fe90a69b3ec5e6dc8a4d54349adb846f22046 Mon Sep 17 00:00:00 2001 From: fsvilas Date: Wed, 8 Jul 2026 13:57:09 +0200 Subject: [PATCH 1/6] First version supporting spm with flutter >=3.44.0 --- CHANGELOG_UNRELEASED.md | 17 +++ README.md | 24 +++- example/android/gradle.properties | 4 + example/ios/Flutter/AppFrameworkInfo.plist | 2 - example/ios/Flutter/Debug.xcconfig | 1 - example/ios/Flutter/Release.xcconfig | 1 - example/ios/Podfile | 49 -------- example/ios/Podfile.lock | 43 ------- example/ios/Runner.xcodeproj/project.pbxproj | 111 ++++++++---------- .../xcshareddata/swiftpm/Package.resolved | 14 +++ .../xcshareddata/xcschemes/Runner.xcscheme | 18 +++ .../contents.xcworkspacedata | 3 - .../xcshareddata/swiftpm/Package.resolved | 14 +++ example/pubspec.lock | 84 ++++++------- example/pubspec.yaml | 2 +- ios/situm_flutter.podspec | 7 +- ios/situm_flutter/Package.swift | 34 ++++++ .../Sources/situm_flutter}/SITFSDKPlugin.m | 8 +- .../Sources/situm_flutter}/SITFSDKUtils.m | 2 +- .../situm_flutter}/SITNavigationHandler.m | 2 +- .../situm_flutter}/SITTextToSpeechManager.m | 6 +- .../SitumFlutterWayfindingPlugin.m | 4 +- .../include/situm_flutter}/SITFSDKPlugin.h | 0 .../include/situm_flutter}/SITFSDKUtils.h | 0 .../situm_flutter}/SITNavigationHandler.h | 0 .../situm_flutter}/SITTextToSpeechManager.h | 0 .../SitumFlutterWayfindingPlugin.h | 0 .../situm_flutter-Bridging-Header.h | 0 pubspec.yaml | 14 +-- 29 files changed, 232 insertions(+), 232 deletions(-) delete mode 100644 example/ios/Podfile delete mode 100644 example/ios/Podfile.lock create mode 100644 example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved create mode 100644 example/ios/Runner.xcworkspace/xcshareddata/swiftpm/Package.resolved create mode 100644 ios/situm_flutter/Package.swift rename ios/{Classes => situm_flutter/Sources/situm_flutter}/SITFSDKPlugin.m (99%) rename ios/{Classes => situm_flutter/Sources/situm_flutter}/SITFSDKUtils.m (95%) rename ios/{Classes => situm_flutter/Sources/situm_flutter}/SITNavigationHandler.m (98%) rename ios/{Classes => situm_flutter/Sources/situm_flutter}/SITTextToSpeechManager.m (92%) rename ios/{Classes => situm_flutter/Sources/situm_flutter}/SitumFlutterWayfindingPlugin.m (83%) rename ios/{Classes => situm_flutter/Sources/situm_flutter/include/situm_flutter}/SITFSDKPlugin.h (100%) rename ios/{Classes => situm_flutter/Sources/situm_flutter/include/situm_flutter}/SITFSDKUtils.h (100%) rename ios/{Classes => situm_flutter/Sources/situm_flutter/include/situm_flutter}/SITNavigationHandler.h (100%) rename ios/{Classes => situm_flutter/Sources/situm_flutter/include/situm_flutter}/SITTextToSpeechManager.h (100%) rename ios/{Classes => situm_flutter/Sources/situm_flutter/include/situm_flutter}/SitumFlutterWayfindingPlugin.h (100%) rename ios/{Classes => situm_flutter/Sources/situm_flutter}/situm_flutter-Bridging-Header.h (100%) diff --git a/CHANGELOG_UNRELEASED.md b/CHANGELOG_UNRELEASED.md index e69de29b..9020a782 100644 --- a/CHANGELOG_UNRELEASED.md +++ b/CHANGELOG_UNRELEASED.md @@ -0,0 +1,17 @@ +## 4.0.0 + +### Breaking changes + +- Require Flutter 3.44.0 or later. +- Require Dart 3.12.0 or later. +- Require iOS 16.0 or later. + +### Added + +- Add Swift Package Manager support for the iOS plugin while keeping CocoaPods support. +- Migrate the iOS example app to Swift Package Manager. + +### Notes + +- Document the `-ObjC` linker flag required by SitumSDK when using Swift Package Manager. +- Update WebView Flutter dependencies to versions that can participate in a Swift Package Manager iOS build. diff --git a/README.md b/README.md index 095665cf..5d9d4c31 100644 --- a/README.md +++ b/README.md @@ -23,6 +23,14 @@ There is a comprehensive tutorial on how to set-up a new application using this Below you will find the basic steps to install and configure the plugin on your Flutter project. These steps have already been done for you in the example application of this repository, but they are required for other projects. +## Requirements + +Starting with version 4.0.0, this plugin requires: + +- Flutter 3.44.0 or later +- Dart 3.12.0 or later +- iOS 16.0 or later + ## Running the example Check the [example/README](./example/README.md) file of this repository to create your first Flutter application using Situm Flutter. @@ -56,11 +64,21 @@ up a Situm account. ### iOS -1. Remove the "use_frameworks!" directive in the `Podfile` of your iOS project: +On iOS, the plugin supports both CocoaPods and Swift Package Manager for native +dependencies. Flutter 3.44.0 and later enables Swift Package Manager by default. + +When using Swift Package Manager, add `$(inherited) -ObjC` to your app target's +`Other Linker Flags` build setting. This is required by SitumSDK's Swift package. + +If your project uses CocoaPods: + +1. Remove the "use_frameworks!" directive in the `Podfile` of your iOS project. 2. Run `pod install` or `pod update` to bring the dependencies to your project. -3. Declare the following permissions in your app's `Info.plist` file to successfully start positioning: +For both CocoaPods and Swift Package Manager: + +1. Declare the following permissions in your app's `Info.plist` file to successfully start positioning: ``` NSLocationWhenInUseUsageDescription @@ -71,7 +89,7 @@ up a Situm account. We use your phone sensors (giroscope, accelerometer and altimeter) to improve location quality ``` -4. For offline support you will have to add the underlying web application's domain inside the entry `WKAppBoundDomains` on `Info.plist` as follows: +2. For offline support you will have to add the underlying web application's domain inside the entry `WKAppBoundDomains` on `Info.plist` as follows: ``` WKAppBoundDomains diff --git a/example/android/gradle.properties b/example/android/gradle.properties index 94adc3a3..eac5ff93 100644 --- a/example/android/gradle.properties +++ b/example/android/gradle.properties @@ -1,3 +1,7 @@ org.gradle.jvmargs=-Xmx1536M android.useAndroidX=true android.enableJetifier=true +# This builtInKotlin flag was added automatically by Flutter migrator +android.builtInKotlin=false +# This newDsl flag was added automatically by Flutter migrator +android.newDsl=false diff --git a/example/ios/Flutter/AppFrameworkInfo.plist b/example/ios/Flutter/AppFrameworkInfo.plist index 1dc6cf76..391a902b 100644 --- a/example/ios/Flutter/AppFrameworkInfo.plist +++ b/example/ios/Flutter/AppFrameworkInfo.plist @@ -20,7 +20,5 @@ ???? CFBundleVersion 1.0 - MinimumOSVersion - 13.0 diff --git a/example/ios/Flutter/Debug.xcconfig b/example/ios/Flutter/Debug.xcconfig index ec97fc6f..592ceee8 100644 --- a/example/ios/Flutter/Debug.xcconfig +++ b/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/example/ios/Flutter/Release.xcconfig b/example/ios/Flutter/Release.xcconfig index c4855bfe..592ceee8 100644 --- a/example/ios/Flutter/Release.xcconfig +++ b/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/example/ios/Podfile b/example/ios/Podfile deleted file mode 100644 index 616fc492..00000000 --- a/example/ios/Podfile +++ /dev/null @@ -1,49 +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! - use_modular_headers! - - flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__)) -end - -post_install do |installer| - installer.pods_project.targets.each do |target| - flutter_additional_ios_build_settings(target) - # permission_handler package: - target.build_configurations.each do |config| - config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] ||= [ - '$(inherited)', - 'PERMISSION_LOCATION=1', - 'PERMISSION_SENSORS=1', - ] - end - end -end diff --git a/example/ios/Podfile.lock b/example/ios/Podfile.lock deleted file mode 100644 index a0fabceb..00000000 --- a/example/ios/Podfile.lock +++ /dev/null @@ -1,43 +0,0 @@ -PODS: - - Flutter (1.0.0) - - Protobuf (3.29.6) - - situm_flutter (3.27.24): - - Flutter - - SitumSDK (~> 3.37.2) - - SitumSDK (3.37.2): - - Protobuf (~> 3.18) - - SSZipArchive (~> 2.4) - - SSZipArchive (2.4.3) - - webview_flutter_wkwebview (0.0.1): - - Flutter - -DEPENDENCIES: - - Flutter (from `Flutter`) - - situm_flutter (from `.symlinks/plugins/situm_flutter/ios`) - - webview_flutter_wkwebview (from `.symlinks/plugins/webview_flutter_wkwebview/ios`) - -SPEC REPOS: - trunk: - - Protobuf - - SitumSDK - - SSZipArchive - -EXTERNAL SOURCES: - Flutter: - :path: Flutter - situm_flutter: - :path: ".symlinks/plugins/situm_flutter/ios" - webview_flutter_wkwebview: - :path: ".symlinks/plugins/webview_flutter_wkwebview/ios" - -SPEC CHECKSUMS: - Flutter: cabc95a1d2626b1b06e7179b784ebcf0c0cde467 - Protobuf: 8d5596f7468be5400861a6bbfb2dfe9d0d1cde34 - situm_flutter: 6988c6b372f87f5de06e4214370317b6b54659c3 - SitumSDK: b6c6b9b13335b66e2da6a298c717f2493ae8fa78 - SSZipArchive: fe6a26b2a54d5a0890f2567b5cc6de5caa600aef - webview_flutter_wkwebview: 4f3e50f7273d31e5500066ed267e3ae4309c5ae4 - -PODFILE CHECKSUM: 3b749f30a8d5a341f7ae96d089e4c79a0780f0e5 - -COCOAPODS: 1.16.2 diff --git a/example/ios/Runner.xcodeproj/project.pbxproj b/example/ios/Runner.xcodeproj/project.pbxproj index 479ace4a..e13e238a 100644 --- a/example/ios/Runner.xcodeproj/project.pbxproj +++ b/example/ios/Runner.xcodeproj/project.pbxproj @@ -10,10 +10,10 @@ 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; }; 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; }; 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; }; + 78A318202AECB46A00862997 /* FlutterGeneratedPluginSwiftPackage in Frameworks */ = {isa = PBXBuildFile; productRef = 78A3181F2AECB46A00862997 /* FlutterGeneratedPluginSwiftPackage */; }; 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 */; }; - CC7A3EAC950ED2B943750ADE /* libPods-Runner.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 622FCC53EA3C5AF6C05A354E /* libPods-Runner.a */; }; /* End PBXBuildFile section */ /* Begin PBXCopyFilesBuildPhase section */ @@ -32,13 +32,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 = ""; }; - 1BEF33FAEAC872467A465150 /* 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 = ""; }; - 25E3CC944C920EC07C0C4549 /* 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 = ""; }; - 372ABE804D7384EFC38E3ED4 /* 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 = ""; }; 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = ""; }; - 622FCC53EA3C5AF6C05A354E /* libPods-Runner.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-Runner.a"; sourceTree = BUILT_PRODUCTS_DIR; }; 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 = ""; }; + 784666492D4C4C64000A1A5F /* FlutterFramework */ = {isa = PBXFileReference; lastKnownFileType = wrapper; name = FlutterFramework; path = Flutter/ephemeral/Packages/.packages/FlutterFramework; sourceTree = ""; }; + 78DABEA22ED26510000E7860 /* situm_flutter */ = {isa = PBXFileReference; lastKnownFileType = wrapper; name = situm_flutter; path = ../../ios/situm_flutter; sourceTree = ""; }; + 78E0A7A72DC9AD7400C4905E /* FlutterGeneratedPluginSwiftPackage */ = {isa = PBXFileReference; lastKnownFileType = wrapper; name = FlutterGeneratedPluginSwiftPackage; path = Flutter/ephemeral/Packages/FlutterGeneratedPluginSwiftPackage; sourceTree = ""; }; 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = ""; }; 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 = ""; }; @@ -54,26 +53,26 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - CC7A3EAC950ED2B943750ADE /* libPods-Runner.a in Frameworks */, + 78A318202AECB46A00862997 /* FlutterGeneratedPluginSwiftPackage in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ - 9179D30E401B2A0D38B06047 /* Pods */ = { + 6C744F6A63646566FB5CBA4F /* Frameworks */ = { isa = PBXGroup; children = ( - 25E3CC944C920EC07C0C4549 /* Pods-Runner.debug.xcconfig */, - 1BEF33FAEAC872467A465150 /* Pods-Runner.release.xcconfig */, - 372ABE804D7384EFC38E3ED4 /* Pods-Runner.profile.xcconfig */, ); - path = Pods; + name = Frameworks; sourceTree = ""; }; 9740EEB11CF90186004384FC /* Flutter */ = { isa = PBXGroup; children = ( + 78DABEA22ED26510000E7860 /* situm_flutter */, + 784666492D4C4C64000A1A5F /* FlutterFramework */, + 78E0A7A72DC9AD7400C4905E /* FlutterGeneratedPluginSwiftPackage */, 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */, 9740EEB21CF90195004384FC /* Debug.xcconfig */, 7AFA3C8E1D35360C0083082E /* Release.xcconfig */, @@ -88,8 +87,7 @@ 9740EEB11CF90186004384FC /* Flutter */, 97C146F01CF9000F007C117D /* Runner */, 97C146EF1CF9000F007C117D /* Products */, - 9179D30E401B2A0D38B06047 /* Pods */, - B8F1B7F4D1C3BD6D76D40D04 /* Frameworks */, + 6C744F6A63646566FB5CBA4F /* Frameworks */, ); sourceTree = ""; }; @@ -116,14 +114,6 @@ path = Runner; sourceTree = ""; }; - B8F1B7F4D1C3BD6D76D40D04 /* Frameworks */ = { - isa = PBXGroup; - children = ( - 622FCC53EA3C5AF6C05A354E /* libPods-Runner.a */, - ); - name = Frameworks; - sourceTree = ""; - }; /* End PBXGroup section */ /* Begin PBXNativeTarget section */ @@ -131,20 +121,21 @@ isa = PBXNativeTarget; buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */; buildPhases = ( - CB19D89AC9BA619D46B1D95C /* [CP] Check Pods Manifest.lock */, 9740EEB61CF901F6004384FC /* Run Script */, 97C146EA1CF9000F007C117D /* Sources */, 97C146EB1CF9000F007C117D /* Frameworks */, 97C146EC1CF9000F007C117D /* Resources */, 9705A1C41CF9048500538489 /* Embed Frameworks */, 3B06AD1E1E4923F5004D2608 /* Thin Binary */, - DD224155CBFCDEFDC4EA2187 /* [CP] Copy Pods Resources */, ); buildRules = ( ); dependencies = ( ); name = Runner; + packageProductDependencies = ( + 78A3181F2AECB46A00862997 /* FlutterGeneratedPluginSwiftPackage */, + ); productName = Runner; productReference = 97C146EE1CF9000F007C117D /* Runner.app */; productType = "com.apple.product-type.application"; @@ -173,6 +164,9 @@ Base, ); mainGroup = 97C146E51CF9000F007C117D; + packageReferences = ( + 781AD8BC2B33823900A9FFBB /* XCLocalSwiftPackageReference "FlutterGeneratedPluginSwiftPackage" */, + ); productRefGroup = 97C146EF1CF9000F007C117D /* Products */; projectDirPath = ""; projectRoot = ""; @@ -228,45 +222,6 @@ shellPath = /bin/sh; shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build"; }; - CB19D89AC9BA619D46B1D95C /* [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; - }; - DD224155CBFCDEFDC4EA2187 /* [CP] Copy Pods Resources */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputFileListPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources-${CONFIGURATION}-input-files.xcfilelist", - ); - name = "[CP] Copy Pods Resources"; - outputFileListPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources-${CONFIGURATION}-output-files.xcfilelist", - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources.sh\"\n"; - showEnvVarsInLog = 0; - }; /* End PBXShellScriptBuildPhase section */ /* Begin PBXSourcesBuildPhase section */ @@ -342,7 +297,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 = 16.0; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; SUPPORTED_PLATFORMS = iphoneos; @@ -369,6 +324,10 @@ "@executable_path/Frameworks", ); ONLY_ACTIVE_ARCH = YES; + OTHER_LDFLAGS = ( + "$(inherited)", + "-ObjC", + ); PRODUCT_BUNDLE_IDENTIFIER = com.situm.flutterWayfindingPlugin; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; @@ -429,7 +388,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 = 16.0; MTL_ENABLE_DEBUG_INFO = YES; ONLY_ACTIVE_ARCH = YES; SDKROOT = iphoneos; @@ -478,7 +437,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 = 16.0; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; SUPPORTED_PLATFORMS = iphoneos; @@ -507,6 +466,10 @@ "@executable_path/Frameworks", ); ONLY_ACTIVE_ARCH = YES; + OTHER_LDFLAGS = ( + "$(inherited)", + "-ObjC", + ); PRODUCT_BUNDLE_IDENTIFIER = com.situm.flutterWayfindingPlugin; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; @@ -539,6 +502,10 @@ "@executable_path/Frameworks", ); ONLY_ACTIVE_ARCH = YES; + OTHER_LDFLAGS = ( + "$(inherited)", + "-ObjC", + ); PRODUCT_BUNDLE_IDENTIFIER = com.situm.flutterWayfindingPlugin; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; @@ -576,6 +543,20 @@ defaultConfigurationName = Release; }; /* End XCConfigurationList section */ + +/* Begin XCLocalSwiftPackageReference section */ + 781AD8BC2B33823900A9FFBB /* XCLocalSwiftPackageReference "FlutterGeneratedPluginSwiftPackage" */ = { + isa = XCLocalSwiftPackageReference; + relativePath = Flutter/ephemeral/Packages/FlutterGeneratedPluginSwiftPackage; + }; +/* End XCLocalSwiftPackageReference section */ + +/* Begin XCSwiftPackageProductDependency section */ + 78A3181F2AECB46A00862997 /* FlutterGeneratedPluginSwiftPackage */ = { + isa = XCSwiftPackageProductDependency; + productName = FlutterGeneratedPluginSwiftPackage; + }; +/* End XCSwiftPackageProductDependency section */ }; rootObject = 97C146E61CF9000F007C117D /* Project object */; } diff --git a/example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved b/example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved new file mode 100644 index 00000000..7728cd6a --- /dev/null +++ b/example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -0,0 +1,14 @@ +{ + "pins" : [ + { + "identity" : "situm-sdk-spm", + "kind" : "remoteSourceControl", + "location" : "https://github.com/situmtech/situm-sdk-spm", + "state" : { + "revision" : "bb86f356ee14fd818ad66e7a9a3ae81891808b03", + "version" : "3.40.0" + } + } + ], + "version" : 2 +} diff --git a/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme index 9c12df59..5db441f5 100644 --- a/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme +++ b/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme @@ -5,6 +5,24 @@ + + + + + + + + + + - - diff --git a/example/ios/Runner.xcworkspace/xcshareddata/swiftpm/Package.resolved b/example/ios/Runner.xcworkspace/xcshareddata/swiftpm/Package.resolved new file mode 100644 index 00000000..7728cd6a --- /dev/null +++ b/example/ios/Runner.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -0,0 +1,14 @@ +{ + "pins" : [ + { + "identity" : "situm-sdk-spm", + "kind" : "remoteSourceControl", + "location" : "https://github.com/situmtech/situm-sdk-spm", + "state" : { + "revision" : "bb86f356ee14fd818ad66e7a9a3ae81891808b03", + "version" : "3.40.0" + } + } + ], + "version" : 2 +} diff --git a/example/pubspec.lock b/example/pubspec.lock index a2255d56..e3e5e2a8 100644 --- a/example/pubspec.lock +++ b/example/pubspec.lock @@ -21,26 +21,26 @@ packages: dependency: transitive description: name: characters - sha256: "04a925763edad70e8443c99234dc3328f442e811f1d8fd1a72f1c8ad0f69a605" + sha256: faf38497bda5ead2a8c7615f4f7939df04333478bf32e4173fcb06d428b5716b url: "https://pub.dev" source: hosted - version: "1.3.0" + version: "1.4.1" clock: dependency: transitive description: name: clock - sha256: cb6d7f03e1de671e34607e909a7213e31d7752be4fb66a86d29fe1eb14bfb5cf + sha256: fddb70d9b5277016c77a80201021d40a2247104d9f4aa7bab7157b7e3f05b84b url: "https://pub.dev" source: hosted - version: "1.1.1" + version: "1.1.2" collection: dependency: transitive description: name: collection - sha256: ee67cb0715911d28db6bf4af1026078bd6f0128b07a5f66fb2ed94ec6783c09a + sha256: "2f5709ae4d3d59dd8f7cd309b4e023046b57d8a6c82130785d2b0e5868084e76" url: "https://pub.dev" source: hosted - version: "1.18.0" + version: "1.19.1" cupertino_icons: dependency: "direct main" description: @@ -53,10 +53,10 @@ packages: dependency: transitive description: name: fake_async - sha256: "511392330127add0b769b75a987850d136345d9227c6b94c96a04cf4a391bf78" + sha256: "5368f224a74523e8d2e7399ea1638b37aecfca824a3cc4dfdf77bf1fa905ac44" url: "https://pub.dev" source: hosted - version: "1.3.1" + version: "1.3.3" flutter: dependency: "direct main" description: flutter @@ -79,26 +79,26 @@ packages: dependency: transitive description: name: leak_tracker - sha256: "3f87a60e8c63aecc975dda1ceedbc8f24de75f09e4856ea27daf8958f2f0ce05" + sha256: "33e2e26bdd85a0112ec15400c8cbffea70d0f9c3407491f672a2fad47915e2de" url: "https://pub.dev" source: hosted - version: "10.0.5" + version: "11.0.2" leak_tracker_flutter_testing: dependency: transitive description: name: leak_tracker_flutter_testing - sha256: "932549fb305594d82d7183ecd9fa93463e9914e1b67cacc34bc40906594a1806" + sha256: "1dbc140bb5a23c75ea9c4811222756104fbcd1a27173f0c34ca01e16bea473c1" url: "https://pub.dev" source: hosted - version: "3.0.5" + version: "3.0.10" leak_tracker_testing: dependency: transitive description: name: leak_tracker_testing - sha256: "6ba465d5d76e67ddf503e1161d1f4a6bc42306f9d66ca1e8f079a47290fb06d3" + sha256: "8d5a2d49f4a66b49744b23b018848400d23e54caf9463f4eb20df3eb8acb2eb1" url: "https://pub.dev" source: hosted - version: "3.0.1" + version: "3.0.2" lints: dependency: transitive description: @@ -111,34 +111,34 @@ packages: dependency: transitive description: name: matcher - sha256: d2323aa2060500f906aa31a895b4030b6da3ebdcc5619d14ce1aada65cd161cb + sha256: dc0b7dc7651697ea4ff3e69ef44b0407ea32c487a39fff6a4004fa585e901861 url: "https://pub.dev" source: hosted - version: "0.12.16+1" + version: "0.12.19" material_color_utilities: 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: name: meta - sha256: bdb68674043280c3428e9ec998512fb681678676b3c54e773629ffe74419f8c7 + sha256: "1741988757a65eb6b36abe716829688cf01910bbf91c34354ff7ec1c3de2b349" url: "https://pub.dev" source: hosted - version: "1.15.0" + version: "1.18.0" path: dependency: transitive description: name: path - sha256: "087ce49c3f0dc39180befefc60fdb4acd8f8620e5682fe2476afd0b3688bb4af" + sha256: "75cca69d1490965be98c73ceaea117e8a04dd21217b37b292c9ddbec0d955bc5" url: "https://pub.dev" source: hosted - version: "1.9.0" + version: "1.9.1" plugin_platform_interface: dependency: transitive description: @@ -153,12 +153,12 @@ packages: path: ".." relative: true source: path - version: "3.27.40" + version: "4.0.0" sky_engine: dependency: transitive description: flutter source: sdk - version: "0.0.99" + version: "0.0.0" source_span: dependency: transitive description: @@ -171,18 +171,18 @@ packages: dependency: transitive description: name: stack_trace - sha256: "73713990125a6d93122541237550ee3352a2d84baad52d375a4cad2eb9b7ce0b" + sha256: "8b27215b45d22309b5cddda1aa2b19bdfec9df0e765f2de506401c071d38d1b1" url: "https://pub.dev" source: hosted - version: "1.11.1" + version: "1.12.1" stream_channel: dependency: transitive description: name: stream_channel - sha256: ba2aa5d8cc609d96bbb2899c28934f9e1af5cddbd60a827822ea467161eb54e7 + sha256: "969e04c80b8bcdf826f8f16579c7b14d780458bd97f56d107d3950fdbeef059d" url: "https://pub.dev" source: hosted - version: "2.1.2" + version: "2.1.4" string_scanner: dependency: transitive description: @@ -203,18 +203,18 @@ packages: dependency: transitive description: name: test_api - sha256: "5b8a98dafc4d5c4c9c72d8b31ab2b23fc13422348d2997120294d3bac86b4ddb" + sha256: "949a932224383300f01be9221c39180316445ecb8e7547f70a41a35bf421fb9e" url: "https://pub.dev" source: hosted - version: "0.7.2" + version: "0.7.11" vector_math: dependency: transitive description: name: vector_math - sha256: "80b3257d1492ce4d091729e3a67a60407d227c27241d6927be0130c98e741803" + sha256: d530bd74fea330e6e364cda7a85019c434070188383e1cd8d9777ee586914c5b url: "https://pub.dev" source: hosted - version: "2.1.4" + version: "2.2.0" vm_service: dependency: transitive description: @@ -227,34 +227,34 @@ packages: dependency: transitive description: name: webview_flutter - sha256: d81b68e88cc353e546afb93fb38958e3717282c5ac6e5d3be4a4aef9fc3c1413 + sha256: d53e1ccf5516f25017e3c9d44c39034db352d20fa34fe200674270242c2c5111 url: "https://pub.dev" source: hosted - version: "4.5.0" + version: "4.14.1" webview_flutter_android: dependency: transitive description: name: webview_flutter_android - sha256: "47a8da40d02befda5b151a26dba71f47df471cddd91dfdb7802d0a87c5442558" + sha256: a97db7a44f8e71af2f3971c45550a08cce1fb60059c1b8e534251e6cfb753490 url: "https://pub.dev" source: hosted - version: "3.16.9" + version: "4.13.0" webview_flutter_platform_interface: dependency: transitive description: name: webview_flutter_platform_interface - sha256: "7cb32b21825bd65569665c32bb00a34ded5779786d6201f5350979d2d529940d" + sha256: "1221c1b12f5278791042f2ec2841743784cf25c5a644e23d6680e5d718824f04" url: "https://pub.dev" source: hosted - version: "2.13.0" + version: "2.15.1" webview_flutter_wkwebview: dependency: transitive description: name: webview_flutter_wkwebview - sha256: "4d062ad505390ecef1c4bfb6001cd857a51e00912cc9dfb66edb1886a9ebd80c" + sha256: c879dd64b87c452aa84381b244d5469da57ba7e8cca6884c7b1e0d406372c12d url: "https://pub.dev" source: hosted - version: "3.10.2" + version: "3.26.0" sdks: - dart: ">=3.5.0 <4.0.0" - flutter: ">=3.24.0" + dart: ">=3.12.0 <4.0.0" + flutter: ">=3.44.0" diff --git a/example/pubspec.yaml b/example/pubspec.yaml index a9f103b8..c05daa83 100644 --- a/example/pubspec.yaml +++ b/example/pubspec.yaml @@ -6,7 +6,7 @@ description: Demonstrates how to use the situm_flutter plugin. publish_to: "none" # Remove this line if you wish to publish to pub.dev environment: - sdk: ">=2.18.1 <3.0.0" + sdk: ">=3.12.0 <4.0.0" # Dependencies specify other packages that your package needs in order to work. # To automatically upgrade your package dependencies to the latest versions diff --git a/ios/situm_flutter.podspec b/ios/situm_flutter.podspec index ea2836de..9daf0a86 100644 --- a/ios/situm_flutter.podspec +++ b/ios/situm_flutter.podspec @@ -4,7 +4,7 @@ # Pod::Spec.new do |s| s.name = 'situm_flutter' - s.version = '3.27.40' + s.version = '4.0.0' s.summary = 'Situm Flutter plugin.' s.description = <<-DESC Situm Flutter plugin. @@ -13,10 +13,11 @@ Pod::Spec.new do |s| s.license = { :file => '../LICENSE' } s.author = { 'Situm Technologies S.L.' => 'situm@situm.com' } s.source = { :path => '.' } - s.source_files = 'Classes/**/*' + s.source_files = 'situm_flutter/Sources/situm_flutter/**/*.{h,m}' + s.public_header_files = 'situm_flutter/Sources/situm_flutter/include/situm_flutter/**/*.h' s.dependency 'Flutter' s.dependency 'SitumSDK', '~> 3.40.0' - s.platform = :ios, '9.0' + s.platform = :ios, '16.0' # Flutter.framework does not contain a i386 slice. s.pod_target_xcconfig = { 'DEFINES_MODULE' => 'YES', 'EXCLUDED_ARCHS[sdk=iphonesimulator*]' => 'i386' } diff --git a/ios/situm_flutter/Package.swift b/ios/situm_flutter/Package.swift new file mode 100644 index 00000000..bdc8d13e --- /dev/null +++ b/ios/situm_flutter/Package.swift @@ -0,0 +1,34 @@ +// swift-tools-version: 5.9 +// The swift-tools-version declares the minimum version of Swift required to build this package. + +import PackageDescription + +let package = Package( + name: "situm_flutter", + platforms: [ + .iOS("16.0") + ], + products: [ + .library(name: "situm-flutter", targets: ["situm_flutter"]) + ], + dependencies: [ + .package(name: "FlutterFramework", path: "../FlutterFramework"), + .package(url: "https://github.com/situmtech/situm-sdk-spm", .upToNextMinor(from: "3.40.0")) + ], + targets: [ + .target( + name: "situm_flutter", + dependencies: [ + .product(name: "FlutterFramework", package: "FlutterFramework"), + .product(name: "SitumSDK", package: "situm-sdk-spm") + ], + cSettings: [ + .headerSearchPath("include/situm_flutter") + ], + linkerSettings: [ + .linkedFramework("AVFoundation"), + .linkedFramework("CoreLocation") + ] + ) + ] +) diff --git a/ios/Classes/SITFSDKPlugin.m b/ios/situm_flutter/Sources/situm_flutter/SITFSDKPlugin.m similarity index 99% rename from ios/Classes/SITFSDKPlugin.m rename to ios/situm_flutter/Sources/situm_flutter/SITFSDKPlugin.m index ee1b477f..418588f1 100644 --- a/ios/Classes/SITFSDKPlugin.m +++ b/ios/situm_flutter/Sources/situm_flutter/SITFSDKPlugin.m @@ -5,12 +5,12 @@ // Created by Abraham Barros Barros on 30/9/22. // -#import "SITFSDKPlugin.h" -#import "SITFSDKUtils.h" +#import "./include/situm_flutter/SITFSDKPlugin.h" +#import "./include/situm_flutter/SITFSDKUtils.h" #import #import -#import "SITNavigationHandler.h" -#import "SITTextToSpeechManager.h" +#import "./include/situm_flutter/SITNavigationHandler.h" +#import "./include/situm_flutter/SITTextToSpeechManager.h" @interface SITFSDKPlugin() diff --git a/ios/Classes/SITFSDKUtils.m b/ios/situm_flutter/Sources/situm_flutter/SITFSDKUtils.m similarity index 95% rename from ios/Classes/SITFSDKUtils.m rename to ios/situm_flutter/Sources/situm_flutter/SITFSDKUtils.m index 96ebbb90..56083457 100644 --- a/ios/Classes/SITFSDKUtils.m +++ b/ios/situm_flutter/Sources/situm_flutter/SITFSDKUtils.m @@ -5,7 +5,7 @@ // Created by albasitum on 6/3/23. // -#import "SITFSDKUtils.h" +#import "./include/situm_flutter/SITFSDKUtils.h" @implementation SITFSDKUtils diff --git a/ios/Classes/SITNavigationHandler.m b/ios/situm_flutter/Sources/situm_flutter/SITNavigationHandler.m similarity index 98% rename from ios/Classes/SITNavigationHandler.m rename to ios/situm_flutter/Sources/situm_flutter/SITNavigationHandler.m index af941914..123d295a 100644 --- a/ios/Classes/SITNavigationHandler.m +++ b/ios/situm_flutter/Sources/situm_flutter/SITNavigationHandler.m @@ -5,7 +5,7 @@ // Created by fsvilas on 9/5/23. // -#import "SITNavigationHandler.h" +#import "./include/situm_flutter/SITNavigationHandler.h" #import static const NSTimeInterval kMinNavigationUpdateInterval = 1.0; diff --git a/ios/Classes/SITTextToSpeechManager.m b/ios/situm_flutter/Sources/situm_flutter/SITTextToSpeechManager.m similarity index 92% rename from ios/Classes/SITTextToSpeechManager.m rename to ios/situm_flutter/Sources/situm_flutter/SITTextToSpeechManager.m index 430842ce..93ae79ea 100644 --- a/ios/Classes/SITTextToSpeechManager.m +++ b/ios/situm_flutter/Sources/situm_flutter/SITTextToSpeechManager.m @@ -3,7 +3,7 @@ // situm_flutter // -#import "SITTextToSpeechManager.h" +#import "./include/situm_flutter/SITTextToSpeechManager.h" @interface SITTextToSpeechManager () @property (nonatomic, strong) AVSpeechSynthesizer *synthesizer; @@ -16,9 +16,7 @@ - (instancetype)init { if (self) { self.synthesizer = [AVSpeechSynthesizer new]; self.synthesizer.delegate = self; - if (@available(iOS 13.0, *)) { - self.synthesizer.usesApplicationAudioSession = false; - } + self.synthesizer.usesApplicationAudioSession = false; } return self; } diff --git a/ios/Classes/SitumFlutterWayfindingPlugin.m b/ios/situm_flutter/Sources/situm_flutter/SitumFlutterWayfindingPlugin.m similarity index 83% rename from ios/Classes/SitumFlutterWayfindingPlugin.m rename to ios/situm_flutter/Sources/situm_flutter/SitumFlutterWayfindingPlugin.m index 170a8abb..3f692835 100644 --- a/ios/Classes/SitumFlutterWayfindingPlugin.m +++ b/ios/situm_flutter/Sources/situm_flutter/SitumFlutterWayfindingPlugin.m @@ -1,4 +1,4 @@ -#import "SitumFlutterWayfindingPlugin.h" +#import "./include/situm_flutter/SitumFlutterWayfindingPlugin.h" #if __has_include() #import #else @@ -8,7 +8,7 @@ // #import "situm_flutter-Swift.h" #endif -#import "SITFSDKPlugin.h" +#import "./include/situm_flutter/SITFSDKPlugin.h" @implementation SitumFlutterWayfindingPlugin + (void)registerWithRegistrar:(NSObject*)registrar { diff --git a/ios/Classes/SITFSDKPlugin.h b/ios/situm_flutter/Sources/situm_flutter/include/situm_flutter/SITFSDKPlugin.h similarity index 100% rename from ios/Classes/SITFSDKPlugin.h rename to ios/situm_flutter/Sources/situm_flutter/include/situm_flutter/SITFSDKPlugin.h diff --git a/ios/Classes/SITFSDKUtils.h b/ios/situm_flutter/Sources/situm_flutter/include/situm_flutter/SITFSDKUtils.h similarity index 100% rename from ios/Classes/SITFSDKUtils.h rename to ios/situm_flutter/Sources/situm_flutter/include/situm_flutter/SITFSDKUtils.h diff --git a/ios/Classes/SITNavigationHandler.h b/ios/situm_flutter/Sources/situm_flutter/include/situm_flutter/SITNavigationHandler.h similarity index 100% rename from ios/Classes/SITNavigationHandler.h rename to ios/situm_flutter/Sources/situm_flutter/include/situm_flutter/SITNavigationHandler.h diff --git a/ios/Classes/SITTextToSpeechManager.h b/ios/situm_flutter/Sources/situm_flutter/include/situm_flutter/SITTextToSpeechManager.h similarity index 100% rename from ios/Classes/SITTextToSpeechManager.h rename to ios/situm_flutter/Sources/situm_flutter/include/situm_flutter/SITTextToSpeechManager.h diff --git a/ios/Classes/SitumFlutterWayfindingPlugin.h b/ios/situm_flutter/Sources/situm_flutter/include/situm_flutter/SitumFlutterWayfindingPlugin.h similarity index 100% rename from ios/Classes/SitumFlutterWayfindingPlugin.h rename to ios/situm_flutter/Sources/situm_flutter/include/situm_flutter/SitumFlutterWayfindingPlugin.h diff --git a/ios/Classes/situm_flutter-Bridging-Header.h b/ios/situm_flutter/Sources/situm_flutter/situm_flutter-Bridging-Header.h similarity index 100% rename from ios/Classes/situm_flutter-Bridging-Header.h rename to ios/situm_flutter/Sources/situm_flutter/situm_flutter-Bridging-Header.h diff --git a/pubspec.yaml b/pubspec.yaml index 8e329416..463c8e67 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,20 +1,20 @@ name: situm_flutter description: Integrate plug&play navigation experience with floorplans, POIs, routes and turn-by-turn directions in no time. With the power of Situm. -version: 3.27.40 +version: 4.0.0 homepage: https://github.com/situmtech/flutter environment: - sdk: ">=2.18.1 <4.0.0" - flutter: ">=2.5.0" + sdk: ">=3.12.0 <4.0.0" + flutter: ">=3.44.0" dependencies: flutter: sdk: flutter plugin_platform_interface: ^2.0.2 - webview_flutter: ^4.2.2 - webview_flutter_platform_interface: ^2.4.0 - webview_flutter_android: ^3.9.2 - webview_flutter_wkwebview: 3.10.2 + webview_flutter: ^4.14.0 + webview_flutter_platform_interface: ^2.15.1 + webview_flutter_android: ^4.13.0 + webview_flutter_wkwebview: ^3.26.0 dev_dependencies: flutter_test: From 58e8655f8bcf50a8117c1beb749a04fd630883c7 Mon Sep 17 00:00:00 2001 From: fsvilas Date: Thu, 9 Jul 2026 10:19:37 +0200 Subject: [PATCH 2/6] Improvements in example readme --- .gitignore | 4 +++- example/README.md | 9 ++++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 20895aa2..448b1af0 100644 --- a/.gitignore +++ b/.gitignore @@ -9,6 +9,7 @@ .history .svn/ migrate_working_dir/ +.local/ # IntelliJ related *.iml @@ -27,9 +28,10 @@ migrate_working_dir/ **/doc/api/ .dart_tool/ .packages +**/.swiftpm/ build/ # Project **/config.dart **/google_api_key.xml -example/android/app/.cxx/* \ No newline at end of file +example/android/app/.cxx/* diff --git a/example/README.md b/example/README.md index 8d53b7a6..026e116b 100644 --- a/example/README.md +++ b/example/README.md @@ -44,7 +44,14 @@ flutter pub get #### iOS only -Run `pod install` or `pod update` from the `example/ios` folder to bring the dependencies to your project. +The bundled example app uses Swift Package Manager for iOS dependencies. + +> [!NOTE] +> When running this example app on iOS with Swift Package Manager, make sure the +> repository directory is named `situm_flutter`. Some Flutter versions generate +> local Swift package overrides using the plugin directory name, and a different +> checkout folder name can cause a Swift package identity mismatch. This +> limitation is expected to be addressed in a future version. Also check out the project [code signing](https://developer.apple.com/support/code-signing/) before you run the example. From 310c6866afa365e226a00ddcad329c1246f2441d Mon Sep 17 00:00:00 2001 From: fsvilas Date: Wed, 15 Jul 2026 13:54:37 +0200 Subject: [PATCH 3/6] Add fvm to gitignore --- .gitignore | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.gitignore b/.gitignore index 448b1af0..cafc3228 100644 --- a/.gitignore +++ b/.gitignore @@ -35,3 +35,6 @@ build/ **/config.dart **/google_api_key.xml example/android/app/.cxx/* + +# FVM Version Cache +.fvm/ \ No newline at end of file From e1d787efb79d3208098ee911bf2618d8c06851ec Mon Sep 17 00:00:00 2001 From: fsvilas Date: Mon, 20 Jul 2026 14:46:32 +0200 Subject: [PATCH 4/6] Fixes ando doc to make repo folder named situm_flutter --- README.md | 10 ++++++++++ azure-pipelines.yml | 29 +++++++++++++++-------------- example/README.md | 11 +++++++---- example/azure/build-examples.yaml | 14 +++----------- example/azure/common-steps.yaml | 4 +++- example/pubspec.lock | 28 ++++++++++++++-------------- 6 files changed, 52 insertions(+), 44 deletions(-) diff --git a/README.md b/README.md index 5d9d4c31..0846f9f3 100644 --- a/README.md +++ b/README.md @@ -70,6 +70,16 @@ dependencies. Flutter 3.44.0 and later enables Swift Package Manager by default. When using Swift Package Manager, add `$(inherited) -ObjC` to your app target's `Other Linker Flags` build setting. This is required by SitumSDK's Swift package. +> [!NOTE] +> The repository folder name requirement only affects local development of this +> repository and the bundled example app when using Swift Package Manager. Apps +> that consume `situm_flutter` from pub.dev are not affected. +> +> For local development with the example app and Swift Package Manager, clone or +> place this repository in a folder named `situm_flutter`. Some Flutter versions +> generate local Swift package overrides using the plugin directory name, and a +> different checkout folder name can cause Swift package resolution failures. + If your project uses CocoaPods: 1. Remove the "use_frameworks!" directive in the `Podfile` of your iOS project. diff --git a/azure-pipelines.yml b/azure-pipelines.yml index ae61ff1b..2e4811a2 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -35,12 +35,12 @@ steps: - checkout: self fetchTags: false fetchDepth: 1 - path: flutter + path: situm_flutter displayName: checkout self - template: azure-templates/static-analyse.yml@sys_kubernetes_templates parameters: - repoFolder: $(Pipeline.Workspace)/flutter + repoFolder: $(Pipeline.Workspace)/situm_flutter teams: mobile phase: semgrep @@ -61,8 +61,8 @@ steps: export PATH="$PATH:$(Agent.BuildDirectory)/binaries/flutter/bin" - if [ -d "flutter" ];then - cd $(Pipeline.Workspace)/flutter + if [ -d "$(Pipeline.Workspace)/situm_flutter" ];then + cd $(Pipeline.Workspace)/situm_flutter fi echo -e "\n[+] Get Dependencies\n" @@ -73,7 +73,7 @@ steps: - template: azure-templates/static-analyse.yml@sys_kubernetes_templates parameters: - repoFolder: $(Pipeline.Workspace)/flutter + repoFolder: $(Pipeline.Workspace)/situm_flutter teams: mobile phase: trivy @@ -81,6 +81,7 @@ steps: - checkout: self fetchTags: false fetchDepth: 1 + path: situm_flutter displayName: checkout self - ${{ if eq(variables['Build.Reason'],'manual') }}: @@ -109,8 +110,8 @@ steps: - bash: | set -euo pipefail - if [ -d "flutter" ];then - cd flutter + if [ -d "$(Pipeline.Workspace)/situm_flutter" ];then + cd $(Pipeline.Workspace)/situm_flutter fi currentBranch=$(echo $(Build.SourceBranch) | cut -d "/" -f 3,4) echo "##vso[task.setvariable variable=currentBranch]$(echo $currentBranch)" @@ -151,8 +152,8 @@ steps: - bash: | set -euo pipefail - if [ -d "flutter" ];then - cd flutter + if [ -d "$(Pipeline.Workspace)/situm_flutter" ];then + cd $(Pipeline.Workspace)/situm_flutter fi #Export binary paths export PATH="$PATH:$(Agent.BuildDirectory)/binaries/flutter/bin" @@ -188,7 +189,7 @@ steps: bitbucket_user: situmops system: "N/A" server: "github" - repofolder: "flutter" + repofolder: "situm_flutter" mergeBranches: - "master" - "develop" @@ -219,8 +220,8 @@ steps: echo -e "\n[+] Create temporary token \n" gcloud auth print-identity-token --audiences=https://pub.dev | dart pub token add https://pub.dev - if [ -d "flutter" ];then - cd flutter + if [ -d "$(Pipeline.Workspace)/situm_flutter" ];then + cd $(Pipeline.Workspace)/situm_flutter fi echo -e "\n[+] Publish flutter package\n" @@ -231,8 +232,8 @@ steps: - bash: | set -euo pipefail - if [ -d "flutter" ]; then - cd flutter + if [ -d "$(Pipeline.Workspace)/situm_flutter" ]; then + cd $(Pipeline.Workspace)/situm_flutter fi echo -e "\n[+] Pull master changes and change to master branch \n" diff --git a/example/README.md b/example/README.md index 026e116b..cccf170a 100644 --- a/example/README.md +++ b/example/README.md @@ -32,13 +32,13 @@ This folder contains the necessary source code for an example application using The first step is to download this repo: ```bash -git clone https://github.com/situmtech/flutter.git +git clone https://github.com/situmtech/flutter.git situm_flutter ``` And then install the plugin dependencies alongside the `example` app as follows: ```bash -cd flutter/example +cd situm_flutter/example flutter pub get ``` @@ -47,11 +47,14 @@ flutter pub get The bundled example app uses Swift Package Manager for iOS dependencies. > [!NOTE] +> This limitation only affects local development of this repository and the +> bundled example app when using Swift Package Manager. Apps that consume +> `situm_flutter` from pub.dev are not affected. +> > When running this example app on iOS with Swift Package Manager, make sure the > repository directory is named `situm_flutter`. Some Flutter versions generate > local Swift package overrides using the plugin directory name, and a different -> checkout folder name can cause a Swift package identity mismatch. This -> limitation is expected to be addressed in a future version. +> checkout folder name can cause Swift package resolution failures. Also check out the project [code signing](https://developer.apple.com/support/code-signing/) before you run the example. diff --git a/example/azure/build-examples.yaml b/example/azure/build-examples.yaml index e5aa2839..e6b38573 100644 --- a/example/azure/build-examples.yaml +++ b/example/azure/build-examples.yaml @@ -53,7 +53,7 @@ steps: sudo xcode-select -switch $(xcodeVersion) - cd example/ios/fastlane + cd $(Pipeline.Workspace)/situm_flutter/example/ios/fastlane echo -e "\n[+] Setting Apple connection options" @@ -71,14 +71,6 @@ steps: echo -e "\t[+] IPHONEOS_DEPLOYMENT_TARGET: $IPHONEOS_DEPLOYMENT_TARGET" - echo -e "\n[+] Pod deintegrate command \n" - cd .. - rm -rf Podfile.lock - pod deintegrate - - echo -e "\n[+] Pod install with --repo-update option \n" - pod install --repo-update - echo -e "\n[+] Build example with fastlane \n" fastlane ios beta @@ -87,13 +79,13 @@ steps: - ${{ if contains(parameters.system, 'ubuntu') }}: - bash: | export PATH="$PATH:$(Agent.BuildDirectory)/binaries/flutter/bin" - cd example + cd $(Pipeline.Workspace)/situm_flutter/example flutter build apk displayName: Build - bash: | - cd example + cd $(Pipeline.Workspace)/situm_flutter/example if [[ "$(Build.Reason)" == "Manual" ]];then folder="$(FlutterExample_folder)/Manual" diff --git a/example/azure/common-steps.yaml b/example/azure/common-steps.yaml index fa1f4a1b..e3d2fb4a 100644 --- a/example/azure/common-steps.yaml +++ b/example/azure/common-steps.yaml @@ -18,9 +18,11 @@ steps: - checkout: self fetchDepth: 1 fetchTags: false + path: situm_flutter displayName: Clone repository - bash: | + cd $(Pipeline.Workspace)/situm_flutter pluginVersion=$(grep "^version: [0-9\.].*$" pubspec.yaml | awk -F":" '{print $2}') echo "##vso[task.setvariable variable=pluginVersion]$(echo $pluginVersion)" cd example @@ -69,7 +71,7 @@ steps: - bash: | export PATH="$PATH:$(Agent.BuildDirectory)/binaries/flutter/bin" - cd example + cd $(Pipeline.Workspace)/situm_flutter/example echo -e "\n[+] Install flutter dependencies\n" flutter pub get diff --git a/example/pubspec.lock b/example/pubspec.lock index e3e5e2a8..d3700311 100644 --- a/example/pubspec.lock +++ b/example/pubspec.lock @@ -5,18 +5,18 @@ packages: dependency: transitive description: name: async - sha256: "947bfcf187f74dbc5e146c9eb9c0f10c9f8b30743e341481c1e2ed3ecc18c20c" + sha256: e2eb0491ba5ddb6177742d2da23904574082139b07c1e33b8503b9f46f3e1a37 url: "https://pub.dev" source: hosted - version: "2.11.0" + version: "2.13.1" boolean_selector: dependency: transitive description: name: boolean_selector - sha256: "6cfb5af12253eaf2b368f07bacc5a80d1301a071c73360d746b7f2e32d762c66" + sha256: "8aab1771e1243a5063b8b0ff68042d67334e3feab9e95b9490f9a6ebf73b42ea" url: "https://pub.dev" source: hosted - version: "2.1.1" + version: "2.1.2" characters: dependency: transitive description: @@ -45,10 +45,10 @@ packages: dependency: "direct main" description: name: cupertino_icons - sha256: ba631d1c7f7bef6b729a622b7b752645a2d076dba9976925b8f25725a30e1ee6 + sha256: "41e005c33bd814be4d3096aff55b1908d419fde52ca656c8c47719ec745873cd" url: "https://pub.dev" source: hosted - version: "1.0.8" + version: "1.0.9" fake_async: dependency: transitive description: @@ -163,10 +163,10 @@ packages: dependency: transitive description: name: source_span - sha256: "53e943d4206a5e30df338fd4c6e7a077e02254531b138a15aec3bd143c1a8b3c" + sha256: "56a02f1f4cd1a2d96303c0144c93bd6d909eea6bee6bf5a0e0b685edbd4c47ab" url: "https://pub.dev" source: hosted - version: "1.10.0" + version: "1.10.2" stack_trace: dependency: transitive description: @@ -187,18 +187,18 @@ packages: dependency: transitive description: name: string_scanner - sha256: "556692adab6cfa87322a115640c11f13cb77b3f076ddcc5d6ae3c20242bedcde" + sha256: "921cd31725b72fe181906c6a94d987c78e3b98c2e205b397ea399d4054872b43" url: "https://pub.dev" source: hosted - version: "1.2.0" + version: "1.4.1" term_glyph: dependency: transitive description: name: term_glyph - sha256: a29248a84fbb7c79282b40b8c72a1209db169a2e0542bce341da992fe1bc7e84 + sha256: "7f554798625ea768a7518313e58f83891c7f5024f88e46e7182a4558850a4b8e" url: "https://pub.dev" source: hosted - version: "1.2.1" + version: "1.2.2" test_api: dependency: transitive description: @@ -219,10 +219,10 @@ packages: dependency: transitive description: name: vm_service - sha256: "5c5f338a667b4c644744b661f309fb8080bb94b18a7e91ef1dbd343bed00ed6d" + sha256: "0016aef94fc66495ac78af5859181e3f3bf2026bd8eecc72b9565601e19ab360" url: "https://pub.dev" source: hosted - version: "14.2.5" + version: "15.2.0" webview_flutter: dependency: transitive description: From c387c722bf6fc1ec99b44441b0368bca5eec6205 Mon Sep 17 00:00:00 2001 From: fsvilas Date: Mon, 20 Jul 2026 14:53:28 +0200 Subject: [PATCH 5/6] Remove cocoapods last traces --- example/ios/Flutter/Debug.xcconfig | 1 + example/ios/Flutter/Release.xcconfig | 1 + 2 files changed, 2 insertions(+) diff --git a/example/ios/Flutter/Debug.xcconfig b/example/ios/Flutter/Debug.xcconfig index 592ceee8..ec97fc6f 100644 --- a/example/ios/Flutter/Debug.xcconfig +++ b/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/example/ios/Flutter/Release.xcconfig b/example/ios/Flutter/Release.xcconfig index 592ceee8..c4855bfe 100644 --- a/example/ios/Flutter/Release.xcconfig +++ b/example/ios/Flutter/Release.xcconfig @@ -1 +1,2 @@ +#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig" #include "Generated.xcconfig" From 7034118876b950fa7ba62a06b8df37c086b395a6 Mon Sep 17 00:00:00 2001 From: fsvilas Date: Mon, 20 Jul 2026 20:32:27 +0200 Subject: [PATCH 6/6] Refactor import routes --- ios/situm_flutter/Sources/situm_flutter/SITFSDKPlugin.m | 8 ++++---- ios/situm_flutter/Sources/situm_flutter/SITFSDKUtils.m | 2 +- .../Sources/situm_flutter/SITNavigationHandler.m | 2 +- .../Sources/situm_flutter/SITTextToSpeechManager.m | 2 +- .../Sources/situm_flutter/SitumFlutterWayfindingPlugin.m | 4 ++-- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/ios/situm_flutter/Sources/situm_flutter/SITFSDKPlugin.m b/ios/situm_flutter/Sources/situm_flutter/SITFSDKPlugin.m index 418588f1..ee1b477f 100644 --- a/ios/situm_flutter/Sources/situm_flutter/SITFSDKPlugin.m +++ b/ios/situm_flutter/Sources/situm_flutter/SITFSDKPlugin.m @@ -5,12 +5,12 @@ // Created by Abraham Barros Barros on 30/9/22. // -#import "./include/situm_flutter/SITFSDKPlugin.h" -#import "./include/situm_flutter/SITFSDKUtils.h" +#import "SITFSDKPlugin.h" +#import "SITFSDKUtils.h" #import #import -#import "./include/situm_flutter/SITNavigationHandler.h" -#import "./include/situm_flutter/SITTextToSpeechManager.h" +#import "SITNavigationHandler.h" +#import "SITTextToSpeechManager.h" @interface SITFSDKPlugin() diff --git a/ios/situm_flutter/Sources/situm_flutter/SITFSDKUtils.m b/ios/situm_flutter/Sources/situm_flutter/SITFSDKUtils.m index 56083457..96ebbb90 100644 --- a/ios/situm_flutter/Sources/situm_flutter/SITFSDKUtils.m +++ b/ios/situm_flutter/Sources/situm_flutter/SITFSDKUtils.m @@ -5,7 +5,7 @@ // Created by albasitum on 6/3/23. // -#import "./include/situm_flutter/SITFSDKUtils.h" +#import "SITFSDKUtils.h" @implementation SITFSDKUtils diff --git a/ios/situm_flutter/Sources/situm_flutter/SITNavigationHandler.m b/ios/situm_flutter/Sources/situm_flutter/SITNavigationHandler.m index 123d295a..af941914 100644 --- a/ios/situm_flutter/Sources/situm_flutter/SITNavigationHandler.m +++ b/ios/situm_flutter/Sources/situm_flutter/SITNavigationHandler.m @@ -5,7 +5,7 @@ // Created by fsvilas on 9/5/23. // -#import "./include/situm_flutter/SITNavigationHandler.h" +#import "SITNavigationHandler.h" #import static const NSTimeInterval kMinNavigationUpdateInterval = 1.0; diff --git a/ios/situm_flutter/Sources/situm_flutter/SITTextToSpeechManager.m b/ios/situm_flutter/Sources/situm_flutter/SITTextToSpeechManager.m index 93ae79ea..091a2cb0 100644 --- a/ios/situm_flutter/Sources/situm_flutter/SITTextToSpeechManager.m +++ b/ios/situm_flutter/Sources/situm_flutter/SITTextToSpeechManager.m @@ -3,7 +3,7 @@ // situm_flutter // -#import "./include/situm_flutter/SITTextToSpeechManager.h" +#import "SITTextToSpeechManager.h" @interface SITTextToSpeechManager () @property (nonatomic, strong) AVSpeechSynthesizer *synthesizer; diff --git a/ios/situm_flutter/Sources/situm_flutter/SitumFlutterWayfindingPlugin.m b/ios/situm_flutter/Sources/situm_flutter/SitumFlutterWayfindingPlugin.m index 3f692835..170a8abb 100644 --- a/ios/situm_flutter/Sources/situm_flutter/SitumFlutterWayfindingPlugin.m +++ b/ios/situm_flutter/Sources/situm_flutter/SitumFlutterWayfindingPlugin.m @@ -1,4 +1,4 @@ -#import "./include/situm_flutter/SitumFlutterWayfindingPlugin.h" +#import "SitumFlutterWayfindingPlugin.h" #if __has_include() #import #else @@ -8,7 +8,7 @@ // #import "situm_flutter-Swift.h" #endif -#import "./include/situm_flutter/SITFSDKPlugin.h" +#import "SITFSDKPlugin.h" @implementation SitumFlutterWayfindingPlugin + (void)registerWithRegistrar:(NSObject*)registrar {