diff --git a/.gitignore b/.gitignore index dc9e546f..a1ce6d07 100644 --- a/.gitignore +++ b/.gitignore @@ -29,6 +29,7 @@ migrate_working_dir/ **/doc/api/ .dart_tool/ .packages +**/.swiftpm/ build/ # Project 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..0846f9f3 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,31 @@ 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. + +> [!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. 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 +99,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/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 8d53b7a6..cccf170a 100644 --- a/example/README.md +++ b/example/README.md @@ -32,19 +32,29 @@ 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 ``` #### 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] +> 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 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/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/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/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 c7d76bfb..00000000 --- a/example/ios/Podfile.lock +++ /dev/null @@ -1,39 +0,0 @@ -PODS: - - Flutter (1.0.0) - - situm_flutter (3.27.40): - - Flutter - - SitumSDK (~> 3.40.0) - - SitumSDK (3.40.0): - - 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: - - 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 - situm_flutter: 13203e4786e0cb55c5ea061b9603275e4f1f0e65 - SitumSDK: 172f2a95374f51d19ee33abc86b870a227043b1d - SSZipArchive: fe6a26b2a54d5a0890f2567b5cc6de5caa600aef - webview_flutter_wkwebview: 4f3e50f7273d31e5500066ed267e3ae4309c5ae4 - -PODFILE CHECKSUM: 3b749f30a8d5a341f7ae96d089e4c79a0780f0e5 - -COCOAPODS: 1.14.3 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 e32c79dd..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: @@ -153,7 +153,7 @@ packages: path: ".." relative: true source: path - version: "3.27.40" + version: "4.0.0" sky_engine: dependency: transitive description: flutter @@ -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,42 +219,42 @@ 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: 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.10.0-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 4e9af10e..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. @@ -17,7 +17,7 @@ Pod::Spec.new do |s| 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/situm_flutter/Sources/situm_flutter/SITTextToSpeechManager.m b/ios/situm_flutter/Sources/situm_flutter/SITTextToSpeechManager.m index 430842ce..091a2cb0 100644 --- a/ios/situm_flutter/Sources/situm_flutter/SITTextToSpeechManager.m +++ b/ios/situm_flutter/Sources/situm_flutter/SITTextToSpeechManager.m @@ -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/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: