diff --git a/.github/actions/publish/action.yml b/.github/actions/publish/action.yml index 681e382ad..a9a62312f 100644 --- a/.github/actions/publish/action.yml +++ b/.github/actions/publish/action.yml @@ -15,7 +15,7 @@ runs: - name: Setup Flutter uses: subosito/flutter-action@v2 with: - flutter-version: 3.38.5 + flutter-version: 3.44.8 - name: Get ID Token uses: actions/github-script@v6 diff --git a/.github/actions/setup/action.yml b/.github/actions/setup/action.yml index a0732b257..151023481 100644 --- a/.github/actions/setup/action.yml +++ b/.github/actions/setup/action.yml @@ -6,7 +6,7 @@ runs: - name: Set up Flutter uses: subosito/flutter-action@ea686d7c56499339ad176e9f19c516ff6cf05a31 with: - flutter-version: 3.38.5 + flutter-version: 3.44.8 cache: true - name: Set up environment paths diff --git a/.vscode/launch.json b/.vscode/launch.json index 84a51f6d5..48a3b1929 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -10,6 +10,12 @@ "request": "launch", "type": "dart" }, - + { + "name": "kiosk_mode_example_app", + "cwd": "kiosk_mode/example", + "program": "lib/main.dart", + "request": "launch", + "type": "dart" + } ] } \ No newline at end of file diff --git a/kiosk_mode/example/ios/.gitignore b/kiosk_mode/example/ios/.gitignore index e96ef602b..2b1ca58a5 100644 --- a/kiosk_mode/example/ios/.gitignore +++ b/kiosk_mode/example/ios/.gitignore @@ -14,6 +14,7 @@ Icon? profile xcuserdata **/.generated/ +Flutter/ephemeral/ Flutter/App.framework Flutter/Flutter.framework Flutter/Flutter.podspec diff --git a/kiosk_mode/example/ios/Flutter/AppFrameworkInfo.plist b/kiosk_mode/example/ios/Flutter/AppFrameworkInfo.plist index 8d4492f97..391a902b2 100644 --- a/kiosk_mode/example/ios/Flutter/AppFrameworkInfo.plist +++ b/kiosk_mode/example/ios/Flutter/AppFrameworkInfo.plist @@ -20,7 +20,5 @@ ???? CFBundleVersion 1.0 - MinimumOSVersion - 9.0 diff --git a/kiosk_mode/example/ios/Podfile b/kiosk_mode/example/ios/Podfile index 1e8c3c90a..e72e0b480 100644 --- a/kiosk_mode/example/ios/Podfile +++ b/kiosk_mode/example/ios/Podfile @@ -1,5 +1,5 @@ # Uncomment this line to define a global platform for your project -# platform :ios, '9.0' +# platform :ios, '13.0' # CocoaPods analytics sends network stats synchronously affecting flutter build latency. ENV['COCOAPODS_DISABLE_STATS'] = 'true' diff --git a/kiosk_mode/example/ios/Podfile.lock b/kiosk_mode/example/ios/Podfile.lock index 300e2d83a..6bcadb9f0 100644 --- a/kiosk_mode/example/ios/Podfile.lock +++ b/kiosk_mode/example/ios/Podfile.lock @@ -14,9 +14,9 @@ EXTERNAL SOURCES: :path: ".symlinks/plugins/kiosk_mode/ios" SPEC CHECKSUMS: - Flutter: 50d75fe2f02b26cc09d224853bb45737f8b3214a - kiosk_mode: 29a54598be6081da927a5eb6949c0ccac7e01de4 + Flutter: cabc95a1d2626b1b06e7179b784ebcf0c0cde467 + kiosk_mode: 3b08368d164d0034877c5c4e2c0d4dabd2f261a9 -PODFILE CHECKSUM: aafe91acc616949ddb318b77800a7f51bffa2a4c +PODFILE CHECKSUM: 0dbd5a87e0ace00c9610d2037ac22083a01f861d -COCOAPODS: 1.10.1 +COCOAPODS: 1.17.0 diff --git a/kiosk_mode/example/ios/Runner.xcodeproj/project.pbxproj b/kiosk_mode/example/ios/Runner.xcodeproj/project.pbxproj index 080d7a89a..773b03a3f 100644 --- a/kiosk_mode/example/ios/Runner.xcodeproj/project.pbxproj +++ b/kiosk_mode/example/ios/Runner.xcodeproj/project.pbxproj @@ -3,7 +3,7 @@ archiveVersion = 1; classes = { }; - objectVersion = 46; + objectVersion = 54; objects = { /* Begin PBXBuildFile section */ @@ -156,7 +156,7 @@ 97C146E61CF9000F007C117D /* Project object */ = { isa = PBXProject; attributes = { - LastUpgradeCheck = 1020; + LastUpgradeCheck = 1510; ORGANIZATIONNAME = ""; TargetAttributes = { 97C146ED1CF9000F007C117D = { @@ -222,10 +222,12 @@ }; 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = { isa = PBXShellScriptBuildPhase; + alwaysOutOfDate = 1; buildActionMask = 2147483647; files = ( ); inputPaths = ( + "${TARGET_BUILD_DIR}/${INFOPLIST_PATH}", ); name = "Thin Binary"; outputPaths = ( @@ -253,6 +255,7 @@ }; 9740EEB61CF901F6004384FC /* Run Script */ = { isa = PBXShellScriptBuildPhase; + alwaysOutOfDate = 1; buildActionMask = 2147483647; files = ( ); @@ -340,7 +343,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 9.0; + IPHONEOS_DEPLOYMENT_TARGET = 13.0; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; SUPPORTED_PLATFORMS = iphoneos; @@ -414,7 +417,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 9.0; + IPHONEOS_DEPLOYMENT_TARGET = 13.0; MTL_ENABLE_DEBUG_INFO = YES; ONLY_ACTIVE_ARCH = YES; SDKROOT = iphoneos; @@ -463,7 +466,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 9.0; + IPHONEOS_DEPLOYMENT_TARGET = 13.0; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; SUPPORTED_PLATFORMS = iphoneos; diff --git a/kiosk_mode/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/kiosk_mode/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme index a28140cfd..0bd6d4227 100644 --- a/kiosk_mode/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme +++ b/kiosk_mode/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme @@ -1,10 +1,28 @@ + + + + + + + + + + @@ -45,11 +64,13 @@ buildConfiguration = "Debug" selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" + customLLDBInitFile = "$(SRCROOT)/Flutter/ephemeral/flutter_lldbinit" launchStyle = "0" useCustomWorkingDirectory = "NO" ignoresPersistentStateOnLaunch = "NO" debugDocumentVersioning = "YES" debugServiceExtension = "internal" + enableGPUValidationMode = "1" allowLocationSimulation = "YES"> diff --git a/kiosk_mode/example/ios/Runner/AppDelegate.swift b/kiosk_mode/example/ios/Runner/AppDelegate.swift index 70693e4a8..c30b367ec 100644 --- a/kiosk_mode/example/ios/Runner/AppDelegate.swift +++ b/kiosk_mode/example/ios/Runner/AppDelegate.swift @@ -1,13 +1,16 @@ -import UIKit 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/kiosk_mode/example/ios/Runner/Info.plist b/kiosk_mode/example/ios/Runner/Info.plist index a060db61e..288ad4196 100644 --- a/kiosk_mode/example/ios/Runner/Info.plist +++ b/kiosk_mode/example/ios/Runner/Info.plist @@ -2,6 +2,8 @@ + CADisableMinimumFrameDurationOnPhone + CFBundleDevelopmentRegion $(DEVELOPMENT_LANGUAGE) CFBundleExecutable @@ -22,6 +24,29 @@ $(FLUTTER_BUILD_NUMBER) LSRequiresIPhoneOS + UIApplicationSceneManifest + + UIApplicationSupportsMultipleScenes + + UISceneConfigurations + + UIWindowSceneSessionRoleApplication + + + UISceneClassName + UIWindowScene + UISceneConfigurationName + flutter + UISceneDelegateClassName + FlutterSceneDelegate + UISceneStoryboardFile + Main + + + + + UIApplicationSupportsIndirectInputEvents + UILaunchStoryboardName LaunchScreen UIMainStoryboardFile diff --git a/kiosk_mode/example/pubspec.yaml b/kiosk_mode/example/pubspec.yaml index e8e9976cb..5c916b1f5 100644 --- a/kiosk_mode/example/pubspec.yaml +++ b/kiosk_mode/example/pubspec.yaml @@ -5,7 +5,7 @@ publish_to: "none" # Remove this line if you wish to publish to pub.dev environment: sdk: ">=3.10.1 <4.0.0" - flutter: ">=3.38.0" + flutter: ">=3.44.0" dependencies: flutter: diff --git a/kiosk_mode/ios/.gitignore b/kiosk_mode/ios/.gitignore index aa479fd3c..9d7339805 100644 --- a/kiosk_mode/ios/.gitignore +++ b/kiosk_mode/ios/.gitignore @@ -34,4 +34,9 @@ Icon? .tags* /Flutter/Generated.xcconfig -/Flutter/flutter_export_environment.sh \ No newline at end of file +/Flutter/flutter_export_environment.sh + +# Swift Package Manager +.build/ +.swiftpm/ +Package.resolved \ No newline at end of file diff --git a/kiosk_mode/ios/Assets/.gitkeep b/kiosk_mode/ios/Assets/.gitkeep deleted file mode 100644 index e69de29bb..000000000 diff --git a/kiosk_mode/ios/Classes/KioskModePlugin.h b/kiosk_mode/ios/Classes/KioskModePlugin.h deleted file mode 100644 index 302789d10..000000000 --- a/kiosk_mode/ios/Classes/KioskModePlugin.h +++ /dev/null @@ -1,4 +0,0 @@ -#import - -@interface KioskModePlugin : NSObject -@end diff --git a/kiosk_mode/ios/Classes/KioskModePlugin.m b/kiosk_mode/ios/Classes/KioskModePlugin.m deleted file mode 100644 index fda25151e..000000000 --- a/kiosk_mode/ios/Classes/KioskModePlugin.m +++ /dev/null @@ -1,15 +0,0 @@ -#import "KioskModePlugin.h" -#if __has_include() -#import -#else -// Support project import fallback if the generated compatibility header -// is not copied when this plugin is created as a library. -// https://forums.swift.org/t/swift-static-libraries-dont-copy-generated-objective-c-header/19816 -#import "kiosk_mode-Swift.h" -#endif - -@implementation KioskModePlugin -+ (void)registerWithRegistrar:(NSObject*)registrar { - [SwiftKioskModePlugin registerWithRegistrar:registrar]; -} -@end diff --git a/kiosk_mode/ios/kiosk_mode.podspec b/kiosk_mode/ios/kiosk_mode.podspec index 75cf51d7f..bafb7a4a6 100644 --- a/kiosk_mode/ios/kiosk_mode.podspec +++ b/kiosk_mode/ios/kiosk_mode.podspec @@ -5,19 +5,18 @@ Pod::Spec.new do |s| s.name = 'kiosk_mode' s.version = '0.0.1' - s.summary = 'Kiosk mode plugin.' + s.summary = 'Plugin for working with Lock Task / Guided Access modes.' s.description = <<-DESC -Kiosk mode plugin. +Plugin for working with Lock Task / Guided Access modes. DESC - s.homepage = 'http://example.com' - s.license = { :file => '../LICENSE' } - s.author = { 'Your Company' => 'email@example.com' } + s.homepage = 'https://github.com/MewsSystems/mews-flutter' + s.license = { :type => 'BSD-3-Clause', :file => '../LICENSE' } + s.author = { 'Mews' => 'developers@mews.com' } s.source = { :path => '.' } - s.source_files = 'Classes/**/*' + s.source_files = 'kiosk_mode/Sources/kiosk_mode/**/*.swift' s.dependency 'Flutter' - s.platform = :ios, '8.0' + s.platform = :ios, '13.0' - # Flutter.framework does not contain a i386 slice. - s.pod_target_xcconfig = { 'DEFINES_MODULE' => 'YES', 'EXCLUDED_ARCHS[sdk=iphonesimulator*]' => 'i386' } + s.pod_target_xcconfig = { 'DEFINES_MODULE' => 'YES' } s.swift_version = '5.0' end diff --git a/kiosk_mode/ios/kiosk_mode/Package.swift b/kiosk_mode/ios/kiosk_mode/Package.swift new file mode 100644 index 000000000..318b27600 --- /dev/null +++ b/kiosk_mode/ios/kiosk_mode/Package.swift @@ -0,0 +1,25 @@ +// 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: "kiosk_mode", + platforms: [ + .iOS("13.0") + ], + products: [ + .library(name: "kiosk-mode", targets: ["kiosk_mode"]) + ], + dependencies: [ + .package(name: "FlutterFramework", path: "../FlutterFramework") + ], + targets: [ + .target( + name: "kiosk_mode", + dependencies: [ + .product(name: "FlutterFramework", package: "FlutterFramework") + ] + ) + ] +) diff --git a/kiosk_mode/ios/Classes/SwiftKioskModePlugin.swift b/kiosk_mode/ios/kiosk_mode/Sources/kiosk_mode/KioskModePlugin.swift similarity index 95% rename from kiosk_mode/ios/Classes/SwiftKioskModePlugin.swift rename to kiosk_mode/ios/kiosk_mode/Sources/kiosk_mode/KioskModePlugin.swift index 4fed4db66..4d70afa66 100644 --- a/kiosk_mode/ios/Classes/SwiftKioskModePlugin.swift +++ b/kiosk_mode/ios/kiosk_mode/Sources/kiosk_mode/KioskModePlugin.swift @@ -1,10 +1,11 @@ import Flutter import UIKit -public class SwiftKioskModePlugin: NSObject, FlutterPlugin { +@objc(KioskModePlugin) +public class KioskModePlugin: NSObject, FlutterPlugin { public static func register(with registrar: FlutterPluginRegistrar) { let channel = FlutterMethodChannel(name: "com.mews.kiosk_mode/kiosk_mode", binaryMessenger: registrar.messenger()) - let instance = SwiftKioskModePlugin() + let instance = KioskModePlugin() registrar.addMethodCallDelegate(instance, channel: channel) let eventChannel = FlutterEventChannel(name: "com.mews.kiosk_mode/kiosk_mode_stream", binaryMessenger: registrar.messenger()) diff --git a/kiosk_mode/pubspec.yaml b/kiosk_mode/pubspec.yaml index 07a4b5a70..84668b002 100644 --- a/kiosk_mode/pubspec.yaml +++ b/kiosk_mode/pubspec.yaml @@ -5,7 +5,7 @@ repository: https://github.com/MewsSystems/mews-flutter environment: sdk: ">=3.10.1 <4.0.0" - flutter: ">=3.38.0" + flutter: ">=3.44.0" dependencies: flutter: