Skip to content

Commit 24461c9

Browse files
committed
Add iOS SceneDelegate support and switch pub source to pub.dev
Added `SceneDelegate.swift` and updated `AppDelegate`, `Info.plist`, and the Xcode project to support the iOS scene lifecycle. Updated `pubspec.lock` to use the official `https://pub.dev` repository URL for all dependencies, replacing the `pub.flutter-io.cn` mirror.
1 parent 2351bd5 commit 24461c9

File tree

6 files changed

+249
-208
lines changed

6 files changed

+249
-208
lines changed

ios/Podfile.lock

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -99,14 +99,14 @@ SPEC CHECKSUMS:
9999
fluttertoast: e9a18c7be5413da53898f660530c56f35edfba9c
100100
OrderedSet: e539b66b644ff081c73a262d24ad552a69be3a94
101101
package_info_plus: 58f0028419748fad15bf008b270aaa8e54380b1c
102-
path_provider_foundation: 2b6b4c569c0fb62ec74538f866245ac84301af46
102+
path_provider_foundation: 0b743cbb62d8e47eab856f09262bb8c1ddcfe6ba
103103
permission_handler_apple: 9878588469a2b0d0fc1e048d9f43605f92e6cec2
104104
rive_common: cbbac3192af00d7341f19dae2f26298e9e37d99e
105-
share_plus: 8875f4f2500512ea181eef553c3e27dba5135aad
106-
shared_preferences_foundation: fcdcbc04712aee1108ac7fda236f363274528f78
105+
share_plus: 8b6f8b3447e494cca5317c8c3073de39b3600d1f
106+
shared_preferences_foundation: 5086985c1d43c5ba4d5e69a4e8083a389e2909e6
107107
sqflite: 673a0e54cc04b7d6dba8d24fb8095b31c3a99eec
108108
Toast: 1f5ea13423a1e6674c4abdac5be53587ae481c4e
109-
url_launcher_ios: 5334b05cef931de560670eeae103fd3e431ac3fe
109+
url_launcher_ios: bb13df5870e8c4234ca12609d04010a21be43dfa
110110
webview_flutter_wkwebview: 29eb20d43355b48fe7d07113835b9128f84e3af4
111111

112112
PODFILE CHECKSUM: 0dbd5a87e0ace00c9610d2037ac22083a01f861d

ios/Runner.xcodeproj/project.pbxproj

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
3B1CF5E1D5F3697BA6D5E888 /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BC05E0EDBFF42659F21BDE4B /* Pods_Runner.framework */; };
1212
3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; };
1313
74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; };
14+
6B771FB42D6F90E700E9D56C /* SceneDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6B771FB32D6F90E700E9D56C /* SceneDelegate.swift */; };
1415
9740EEB41CF90195004384FC /* Debug.xcconfig in Resources */ = {isa = PBXBuildFile; fileRef = 9740EEB21CF90195004384FC /* Debug.xcconfig */; };
1516
9740EEB51CF90195004384FC /* Generated.xcconfig in Resources */ = {isa = PBXBuildFile; fileRef = 9740EEB31CF90195004384FC /* Generated.xcconfig */; };
1617
97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; };
@@ -155,6 +156,7 @@
155156
593F42BD9F603A49DC922B8C /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = "<group>"; };
156157
74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = "<group>"; };
157158
74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
159+
6B771FB32D6F90E700E9D56C /* SceneDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SceneDelegate.swift; sourceTree = "<group>"; };
158160
7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = "<group>"; };
159161
9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = "<group>"; };
160162
9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = "<group>"; };
@@ -252,6 +254,7 @@
252254
1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */,
253255
1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */,
254256
74858FAE1ED2DC5600515810 /* AppDelegate.swift */,
257+
6B771FB32D6F90E700E9D56C /* SceneDelegate.swift */,
255258
74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */,
256259
);
257260
path = Runner;
@@ -591,6 +594,7 @@
591594
buildActionMask = 2147483647;
592595
files = (
593596
74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */,
597+
6B771FB42D6F90E700E9D56C /* SceneDelegate.swift in Sources */,
594598
1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */,
595599
);
596600
runOnlyForDeploymentPostprocessing = 0;

ios/Runner/AppDelegate.swift

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,17 @@ import Flutter
1010
GeneratedPluginRegistrant.register(with: self)
1111
return super.application(application, didFinishLaunchingWithOptions: launchOptions)
1212
}
13+
14+
override func application(
15+
_ application: UIApplication,
16+
configurationForConnecting connectingSceneSession: UISceneSession,
17+
options: UIScene.ConnectionOptions
18+
) -> UISceneConfiguration {
19+
let configuration = UISceneConfiguration(
20+
name: "Default Configuration",
21+
sessionRole: connectingSceneSession.role
22+
)
23+
configuration.delegateClass = SceneDelegate.self
24+
return configuration
25+
}
1326
}

ios/Runner/Info.plist

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,25 @@
5959
<string>LaunchScreen</string>
6060
<key>UIMainStoryboardFile</key>
6161
<string>Main</string>
62+
<key>UIApplicationSceneManifest</key>
63+
<dict>
64+
<key>UIApplicationSupportsMultipleScenes</key>
65+
<false/>
66+
<key>UISceneConfigurations</key>
67+
<dict>
68+
<key>UIWindowSceneSessionRoleApplication</key>
69+
<array>
70+
<dict>
71+
<key>UISceneConfigurationName</key>
72+
<string>Default Configuration</string>
73+
<key>UISceneDelegateClassName</key>
74+
<string>$(PRODUCT_MODULE_NAME).SceneDelegate</string>
75+
<key>UISceneStoryboardFile</key>
76+
<string>Main</string>
77+
</dict>
78+
</array>
79+
</dict>
80+
</dict>
6281
<key>UISupportedInterfaceOrientations</key>
6382
<array>
6483
<string>UIInterfaceOrientationPortrait</string>

ios/Runner/SceneDelegate.swift

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import UIKit
2+
3+
class SceneDelegate: UIResponder, UIWindowSceneDelegate {
4+
var window: UIWindow?
5+
}

0 commit comments

Comments
 (0)