Skip to content

Commit 5e7c607

Browse files
committed
fix: UISceneDelegate adoption Flutter migration
1 parent 99ccd51 commit 5e7c607

6 files changed

Lines changed: 100 additions & 77 deletions

File tree

ios/Flutter/AppFrameworkInfo.plist

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,5 @@
2020
<string>????</string>
2121
<key>CFBundleVersion</key>
2222
<string>1.0</string>
23-
<key>MinimumOSVersion</key>
24-
<string>12.0</string>
2523
</dict>
2624
</plist>

ios/Podfile.lock

Lines changed: 6 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,21 @@
11
PODS:
22
- Flutter (1.0.0)
3-
- flutter_audio_capture (1.1.4):
4-
- Flutter
5-
- path_provider_foundation (0.0.1):
6-
- Flutter
7-
- FlutterMacOS
8-
- permission_handler_apple (9.3.0):
3+
- mp_audio_stream (0.0.3):
94
- Flutter
105

116
DEPENDENCIES:
127
- Flutter (from `Flutter`)
13-
- flutter_audio_capture (from `.symlinks/plugins/flutter_audio_capture/ios`)
14-
- path_provider_foundation (from `.symlinks/plugins/path_provider_foundation/darwin`)
15-
- permission_handler_apple (from `.symlinks/plugins/permission_handler_apple/ios`)
8+
- mp_audio_stream (from `.symlinks/plugins/mp_audio_stream/ios`)
169

1710
EXTERNAL SOURCES:
1811
Flutter:
1912
:path: Flutter
20-
flutter_audio_capture:
21-
:path: ".symlinks/plugins/flutter_audio_capture/ios"
22-
path_provider_foundation:
23-
:path: ".symlinks/plugins/path_provider_foundation/darwin"
24-
permission_handler_apple:
25-
:path: ".symlinks/plugins/permission_handler_apple/ios"
13+
mp_audio_stream:
14+
:path: ".symlinks/plugins/mp_audio_stream/ios"
2615

2716
SPEC CHECKSUMS:
28-
Flutter: e0871f40cf51350855a761d2e70bf5af5b9b5de7
29-
flutter_audio_capture: e1681f0d73912d756ef02313e9505e8d19246867
30-
path_provider_foundation: 080d55be775b7414fd5a5ef3ac137b97b097e564
31-
permission_handler_apple: 4ed2196e43d0651e8ff7ca3483a069d469701f2d
17+
Flutter: cabc95a1d2626b1b06e7179b784ebcf0c0cde467
18+
mp_audio_stream: 3aeeb992433b114917bffc30accf51ce8114aea2
3219

3320
PODFILE CHECKSUM: ec8b70a489dd1f81e53ef185cf7ad30fce8f8d00
3421

ios/Runner.xcodeproj/project.pbxproj

Lines changed: 27 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; };
1313
7411BCAC1905F0C3FAB7736D /* Pods_RunnerTests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4D6E6EC55A91BC77107D1BF6 /* Pods_RunnerTests.framework */; };
1414
74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; };
15+
78A318202AECB46A00862997 /* FlutterGeneratedPluginSwiftPackage in Frameworks */ = {isa = PBXBuildFile; productRef = 78A3181F2AECB46A00862997 /* FlutterGeneratedPluginSwiftPackage */; };
1516
97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; };
1617
97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; };
1718
97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; };
@@ -54,6 +55,7 @@
5455
6887FACC91A099744C4FBA44 /* 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 = "<group>"; };
5556
74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = "<group>"; };
5657
74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
58+
78E0A7A72DC9AD7400C4905E /* FlutterGeneratedPluginSwiftPackage */ = {isa = PBXFileReference; lastKnownFileType = wrapper; name = FlutterGeneratedPluginSwiftPackage; path = Flutter/ephemeral/Packages/FlutterGeneratedPluginSwiftPackage; sourceTree = "<group>"; };
5759
7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = "<group>"; };
5860
9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = "<group>"; };
5961
9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = "<group>"; };
@@ -72,6 +74,7 @@
7274
isa = PBXFrameworksBuildPhase;
7375
buildActionMask = 2147483647;
7476
files = (
77+
78A318202AECB46A00862997 /* FlutterGeneratedPluginSwiftPackage in Frameworks */,
7578
DB29E3C32F13FD638E5A0D7A /* Pods_Runner.framework in Frameworks */,
7679
);
7780
runOnlyForDeploymentPostprocessing = 0;
@@ -120,6 +123,7 @@
120123
9740EEB11CF90186004384FC /* Flutter */ = {
121124
isa = PBXGroup;
122125
children = (
126+
78E0A7A72DC9AD7400C4905E /* FlutterGeneratedPluginSwiftPackage */,
123127
3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */,
124128
9740EEB21CF90195004384FC /* Debug.xcconfig */,
125129
7AFA3C8E1D35360C0083082E /* Release.xcconfig */,
@@ -198,13 +202,15 @@
198202
9705A1C41CF9048500538489 /* Embed Frameworks */,
199203
3B06AD1E1E4923F5004D2608 /* Thin Binary */,
200204
C8B0F9A46182CD022AB63602 /* [CP] Embed Pods Frameworks */,
201-
31EA1FE1A656C4F7D7D9E007 /* [CP] Copy Pods Resources */,
202205
);
203206
buildRules = (
204207
);
205208
dependencies = (
206209
);
207210
name = Runner;
211+
packageProductDependencies = (
212+
78A3181F2AECB46A00862997 /* FlutterGeneratedPluginSwiftPackage */,
213+
);
208214
productName = Runner;
209215
productReference = 97C146EE1CF9000F007C117D /* Runner.app */;
210216
productType = "com.apple.product-type.application";
@@ -238,6 +244,9 @@
238244
Base,
239245
);
240246
mainGroup = 97C146E51CF9000F007C117D;
247+
packageReferences = (
248+
781AD8BC2B33823900A9FFBB /* XCLocalSwiftPackageReference "FlutterGeneratedPluginSwiftPackage" */,
249+
);
241250
productRefGroup = 97C146EF1CF9000F007C117D /* Products */;
242251
projectDirPath = "";
243252
projectRoot = "";
@@ -270,27 +279,6 @@
270279
/* End PBXResourcesBuildPhase section */
271280

272281
/* Begin PBXShellScriptBuildPhase section */
273-
31EA1FE1A656C4F7D7D9E007 /* [CP] Copy Pods Resources */ = {
274-
isa = PBXShellScriptBuildPhase;
275-
buildActionMask = 2147483647;
276-
files = (
277-
);
278-
inputFileListPaths = (
279-
"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources-${CONFIGURATION}-input-files.xcfilelist",
280-
);
281-
inputPaths = (
282-
);
283-
name = "[CP] Copy Pods Resources";
284-
outputFileListPaths = (
285-
"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources-${CONFIGURATION}-output-files.xcfilelist",
286-
);
287-
outputPaths = (
288-
);
289-
runOnlyForDeploymentPostprocessing = 0;
290-
shellPath = /bin/sh;
291-
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources.sh\"\n";
292-
showEnvVarsInLog = 0;
293-
};
294282
3B06AD1E1E4923F5004D2608 /* Thin Binary */ = {
295283
isa = PBXShellScriptBuildPhase;
296284
alwaysOutOfDate = 1;
@@ -352,14 +340,10 @@
352340
inputFileListPaths = (
353341
"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-input-files.xcfilelist",
354342
);
355-
inputPaths = (
356-
);
357343
name = "[CP] Embed Pods Frameworks";
358344
outputFileListPaths = (
359345
"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-output-files.xcfilelist",
360346
);
361-
outputPaths = (
362-
);
363347
runOnlyForDeploymentPostprocessing = 0;
364348
shellPath = /bin/sh;
365349
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n";
@@ -480,7 +464,7 @@
480464
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
481465
GCC_WARN_UNUSED_FUNCTION = YES;
482466
GCC_WARN_UNUSED_VARIABLE = YES;
483-
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
467+
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
484468
MTL_ENABLE_DEBUG_INFO = NO;
485469
SDKROOT = iphoneos;
486470
SUPPORTED_PLATFORMS = iphoneos;
@@ -616,7 +600,7 @@
616600
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
617601
GCC_WARN_UNUSED_FUNCTION = YES;
618602
GCC_WARN_UNUSED_VARIABLE = YES;
619-
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
603+
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
620604
MTL_ENABLE_DEBUG_INFO = YES;
621605
ONLY_ACTIVE_ARCH = YES;
622606
SDKROOT = iphoneos;
@@ -667,7 +651,7 @@
667651
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
668652
GCC_WARN_UNUSED_FUNCTION = YES;
669653
GCC_WARN_UNUSED_VARIABLE = YES;
670-
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
654+
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
671655
MTL_ENABLE_DEBUG_INFO = NO;
672656
SDKROOT = iphoneos;
673657
SUPPORTED_PLATFORMS = iphoneos;
@@ -764,6 +748,20 @@
764748
defaultConfigurationName = Release;
765749
};
766750
/* End XCConfigurationList section */
751+
752+
/* Begin XCLocalSwiftPackageReference section */
753+
781AD8BC2B33823900A9FFBB /* XCLocalSwiftPackageReference "FlutterGeneratedPluginSwiftPackage" */ = {
754+
isa = XCLocalSwiftPackageReference;
755+
relativePath = Flutter/ephemeral/Packages/FlutterGeneratedPluginSwiftPackage;
756+
};
757+
/* End XCLocalSwiftPackageReference section */
758+
759+
/* Begin XCSwiftPackageProductDependency section */
760+
78A3181F2AECB46A00862997 /* FlutterGeneratedPluginSwiftPackage */ = {
761+
isa = XCSwiftPackageProductDependency;
762+
productName = FlutterGeneratedPluginSwiftPackage;
763+
};
764+
/* End XCSwiftPackageProductDependency section */
767765
};
768766
rootObject = 97C146E61CF9000F007C117D /* Project object */;
769767
}

ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,24 @@
55
<BuildAction
66
parallelizeBuildables = "YES"
77
buildImplicitDependencies = "YES">
8+
<PreActions>
9+
<ExecutionAction
10+
ActionType = "Xcode.IDEStandardExecutionActionsCore.ExecutionActionType.ShellScriptAction">
11+
<ActionContent
12+
title = "Run Prepare Flutter Framework Script"
13+
scriptText = "/bin/sh &quot;$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh&quot; prepare&#10;">
14+
<EnvironmentBuildable>
15+
<BuildableReference
16+
BuildableIdentifier = "primary"
17+
BlueprintIdentifier = "97C146ED1CF9000F007C117D"
18+
BuildableName = "Runner.app"
19+
BlueprintName = "Runner"
20+
ReferencedContainer = "container:Runner.xcodeproj">
21+
</BuildableReference>
22+
</EnvironmentBuildable>
23+
</ActionContent>
24+
</ExecutionAction>
25+
</PreActions>
826
<BuildActionEntries>
927
<BuildActionEntry
1028
buildForTesting = "YES"
@@ -26,6 +44,7 @@
2644
buildConfiguration = "Debug"
2745
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
2846
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
47+
customLLDBInitFile = "$(SRCROOT)/Flutter/ephemeral/flutter_lldbinit"
2948
shouldUseLaunchSchemeArgsEnv = "YES">
3049
<MacroExpansion>
3150
<BuildableReference
@@ -54,11 +73,13 @@
5473
buildConfiguration = "Debug"
5574
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
5675
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
76+
customLLDBInitFile = "$(SRCROOT)/Flutter/ephemeral/flutter_lldbinit"
5777
launchStyle = "0"
5878
useCustomWorkingDirectory = "NO"
5979
ignoresPersistentStateOnLaunch = "NO"
6080
debugDocumentVersioning = "YES"
6181
debugServiceExtension = "internal"
82+
enableGPUValidationMode = "1"
6283
allowLocationSimulation = "YES">
6384
<BuildableProductRunnable
6485
runnableDebuggingMode = "0">

ios/Runner/AppDelegate.swift

Lines changed: 25 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import AVFoundation
44
import CoreLocation
55

66
@main
7-
@objc class AppDelegate: FlutterAppDelegate, CLLocationManagerDelegate {
7+
@objc class AppDelegate: FlutterAppDelegate, FlutterImplicitEngineDelegate, CLLocationManagerDelegate {
88

99
private var pendingPermissionResult: FlutterResult?
1010
private var locationManager: CLLocationManager?
@@ -13,35 +13,33 @@ import CoreLocation
1313
_ application: UIApplication,
1414
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
1515
) -> Bool {
16-
guard let controller: FlutterViewController = window?.rootViewController as? FlutterViewController else {
17-
return super.application(application, didFinishLaunchingWithOptions: launchOptions)
18-
}
19-
20-
let permissionChannel = FlutterMethodChannel(
21-
name: "io.pslab/permissions",
22-
binaryMessenger: controller.binaryMessenger
23-
)
24-
25-
permissionChannel.setMethodCallHandler { [weak self] call, result in
26-
guard let args = call.arguments as? [String: Any],
27-
let permission = args["permission"] as? String else {
28-
result(FlutterError(code: "INVALID_ARGS", message: "Missing permission argument", details: nil))
29-
return
30-
}
31-
32-
if call.method == "checkStatus" {
33-
self?.handleCheckStatus(permission: permission, result: result)
34-
} else if call.method == "request" {
35-
self?.handleRequest(permission: permission, result: result)
36-
} else {
37-
result(FlutterMethodNotImplemented)
38-
}
39-
}
40-
41-
GeneratedPluginRegistrant.register(with: self)
4216
return super.application(application, didFinishLaunchingWithOptions: launchOptions)
4317
}
4418

19+
func didInitializeImplicitFlutterEngine(_ engineBridge: FlutterImplicitEngineBridge) {
20+
GeneratedPluginRegistrant.register(with: engineBridge.pluginRegistry)
21+
let permissionChannel = FlutterMethodChannel(
22+
name: "io.pslab/permissions",
23+
binaryMessenger: engineBridge.applicationRegistrar.messenger()
24+
)
25+
26+
permissionChannel.setMethodCallHandler { [weak self] call, result in
27+
guard let args = call.arguments as? [String: Any],
28+
let permission = args["permission"] as? String else {
29+
result(FlutterError(code: "INVALID_ARGS", message: "Missing permission argument", details: nil))
30+
return
31+
}
32+
33+
if call.method == "checkStatus" {
34+
self?.handleCheckStatus(permission: permission, result: result)
35+
} else if call.method == "request" {
36+
self?.handleRequest(permission: permission, result: result)
37+
} else {
38+
result(FlutterMethodNotImplemented)
39+
}
40+
}
41+
}
42+
4543
private func handleCheckStatus(permission: String, result: @escaping FlutterResult) {
4644
if permission == "microphone" {
4745
checkMicrophoneStatus(result: result)

ios/Runner/Info.plist

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,5 +61,26 @@
6161
<true/>
6262
<key>UIRequiresFullScreen</key>
6363
<true/>
64+
<key>UIApplicationSceneManifest</key>
65+
<dict>
66+
<key>UIApplicationSupportsMultipleScenes</key>
67+
<false/>
68+
<key>UISceneConfigurations</key>
69+
<dict>
70+
<key>UIWindowSceneSessionRoleApplication</key>
71+
<array>
72+
<dict>
73+
<key>UISceneClassName</key>
74+
<string>UIWindowScene</string>
75+
<key>UISceneDelegateClassName</key>
76+
<string>FlutterSceneDelegate</string>
77+
<key>UISceneConfigurationName</key>
78+
<string>flutter</string>
79+
<key>UISceneStoryboardFile</key>
80+
<string>Main</string>
81+
</dict>
82+
</array>
83+
</dict>
84+
</dict>
6485
</dict>
6586
</plist>

0 commit comments

Comments
 (0)