HOTFIX Support iOS 26

This commit is contained in:
Dang Dat committed 2026-05-08 10:34:41 +07:00
1 parent a3e8fdb5af
commit 20f216baa7
6 files changed
+69 -36

No files matched your search

+4
View File
@@ -17,6 +17,7 @@
97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; };
97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; };
B561AD69C2BE6DF40BF29406 /* Pods_TwakeMailNSE.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = EA243B93F65E4E3CD7DC0348 /* Pods_TwakeMailNSE.framework */; };
C06B95712FAC780E009C15B4 /* SceneDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = C06B95702FAC7800009C15B4 /* SceneDelegate.swift */; };
CDFECA8C54311B749F044831 /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 5810EDDA99BEFEACD742F507 /* Pods_Runner.framework */; };
F522E87F2C0EE23400DDA35B /* AuthenticationSSOTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = F522E87E2C0EE23400DDA35B /* AuthenticationSSOTests.swift */; };
F522E8812C0EE3F200DDA35B /* AuthenticationSSO.swift in Sources */ = {isa = PBXBuildFile; fileRef = F5E7D8832B3877050009BB8A /* AuthenticationSSO.swift */; };
@@ -147,6 +148,7 @@
AF31502A83CA492E27C36A7B /* Pods-TwakeMailNSE.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-TwakeMailNSE.profile.xcconfig"; path = "Target Support Files/Pods-TwakeMailNSE/Pods-TwakeMailNSE.profile.xcconfig"; sourceTree = "<group>"; };
B2EAFF659572E6B9F5AFAAF8 /* 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 = "<group>"; };
BC08294F5AE09BF8CC592AD1 /* Pods-TeamMailShareExtension.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-TeamMailShareExtension.release.xcconfig"; path = "Target Support Files/Pods-TeamMailShareExtension/Pods-TeamMailShareExtension.release.xcconfig"; sourceTree = "<group>"; };
C06B95702FAC7800009C15B4 /* SceneDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SceneDelegate.swift; sourceTree = "<group>"; };
EA243B93F65E4E3CD7DC0348 /* Pods_TwakeMailNSE.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_TwakeMailNSE.framework; sourceTree = BUILT_PRODUCTS_DIR; };
F522E87E2C0EE23400DDA35B /* AuthenticationSSOTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AuthenticationSSOTests.swift; sourceTree = "<group>"; };
F522E8852C0EE8B600DDA35B /* CoreUtils.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CoreUtils.swift; sourceTree = "<group>"; };
@@ -284,6 +286,7 @@
97C146F01CF9000F007C117D /* Runner */ = {
isa = PBXGroup;
children = (
C06B95702FAC7800009C15B4 /* SceneDelegate.swift */,
4D124E74293A67D900BA5186 /* RunnerProfile.entitlements */,
F52F993D27FD733C00346091 /* Runner.entitlements */,
97C146FA1CF9000F007C117D /* Main.storyboard */,
@@ -836,6 +839,7 @@
F522E8862C0EE8B600DDA35B /* CoreUtils.swift in Sources */,
F522E8812C0EE3F200DDA35B /* AuthenticationSSO.swift in Sources */,
F522E8822C0EE48700DDA35B /* AuthenticationType.swift in Sources */,
C06B95712FAC780E009C15B4 /* SceneDelegate.swift in Sources */,
F5EFC07D2B328B9F00829056 /* TwakeLogger.swift in Sources */,
F5E7D8742B3578F90009BB8A /* JmapConstants.swift in Sources */,
F522E8832C0EE48C00DDA35B /* Authentication.swift in Sources */,
+11 -32
View File
@@ -4,7 +4,7 @@ import receive_sharing_intent
import flutter_local_notifications
@main
@objc class AppDelegate: FlutterAppDelegate {
@objc class AppDelegate: FlutterAppDelegate, FlutterImplicitEngineDelegate {
var notificationInteractionChannel: FlutterMethodChannel?
var fcmMethodChannel: FlutterMethodChannel?
@@ -14,11 +14,6 @@ import flutter_local_notifications
_ application: UIApplication,
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
) -> Bool {
GeneratedPluginRegistrant.register(with: self)
createNotificationInteractionChannel()
createFcmMethodChannel()
if let payload = launchOptions?[.remoteNotification] as? [AnyHashable : Any],
let emailId = payload[JmapConstants.EMAIL_ID] as? String,
!emailId.isEmpty {
@@ -46,9 +41,12 @@ import flutter_local_notifications
return super.application(application, didFinishLaunchingWithOptions: launchOptions)
}
override func applicationDidEnterBackground(_ application: UIApplication) {
updateApplicationStateInUserDefaults(false)
func didInitializeImplicitFlutterEngine(_ engineBridge: FlutterImplicitEngineBridge) {
GeneratedPluginRegistrant.register(with: engineBridge.pluginRegistry)
createNotificationInteractionChannel(engineBridge.applicationRegistrar.messenger())
createFcmMethodChannel(engineBridge.applicationRegistrar.messenger())
}
override func applicationWillTerminate(_ application: UIApplication) {
@@ -70,11 +68,6 @@ import flutter_local_notifications
return super.application(app, open: url, options:options)
}
override func applicationDidBecomeActive(_ application: UIApplication) {
removeAppBadger()
updateApplicationStateInUserDefaults(true)
}
private func handleEmailAndress(open url: URL) -> URL? {
let appDomain = Bundle.main.bundleIdentifier!
let appGroupId = (Bundle.main.object(forInfoDictionaryKey: "AppGroupId") as? String) ?? "group.\(Bundle.main.bundleIdentifier!)"
@@ -150,22 +143,10 @@ extension AppDelegate {
}
}
private func removeAppBadger() {
TwakeLogger.shared.log(message: "AppDelegate::removeAppBadger")
if #available(iOS 16.0, *) {
UNUserNotificationCenter.current().setBadgeCount(0)
} else {
UIApplication.shared.applicationIconBadgeNumber = 0
}
}
private func createNotificationInteractionChannel() {
let controller : FlutterViewController = window?.rootViewController as! FlutterViewController
private func createNotificationInteractionChannel(_ binaryMessenger: FlutterBinaryMessenger) {
self.notificationInteractionChannel = FlutterMethodChannel(
name: CoreUtils.NOTIFICATION_INTERACTION_CHANNEL_NAME,
binaryMessenger: controller.binaryMessenger
binaryMessenger: binaryMessenger
)
self.notificationInteractionChannel?.setMethodCallHandler { (call, result) in
@@ -179,12 +160,10 @@ extension AppDelegate {
}
}
private func createFcmMethodChannel() {
let controller : FlutterViewController = window?.rootViewController as! FlutterViewController
private func createFcmMethodChannel(_ binaryMessenger: FlutterBinaryMessenger) {
self.fcmMethodChannel = FlutterMethodChannel(
name: CoreUtils.FCM_METHOD_CHANNEL_NAME,
binaryMessenger: controller.binaryMessenger
binaryMessenger: binaryMessenger
)
}
+21
View File
@@ -94,5 +94,26 @@
<true/>
<key>UIStatusBarHidden</key>
<false/>
<key>UIApplicationSceneManifest</key>
<dict>
<key>UIApplicationSupportsMultipleScenes</key>
<false/>
<key>UISceneConfigurations</key>
<dict>
<key>UIWindowSceneSessionRoleApplication</key>
<array>
<dict>
<key>UISceneClassName</key>
<string>UIWindowScene</string>
<key>UISceneDelegateClassName</key>
<string>$(PRODUCT_MODULE_NAME).SceneDelegate</string>
<key>UISceneConfigurationName</key>
<string>flutter</string>
<key>UISceneStoryboardFile</key>
<string>Main</string>
</dict>
</array>
</dict>
</dict>
</dict>
</plist>
+28
View File
@@ -0,0 +1,28 @@
import Flutter
import UIKit
class SceneDelegate: FlutterSceneDelegate {
override func sceneDidBecomeActive(_ scene: UIScene) {
removeAppBadger()
updateApplicationStateInUserDefaults(true)
}
override func sceneDidEnterBackground(_ scene: UIScene) {
updateApplicationStateInUserDefaults(false)
}
private func removeAppBadger() {
TwakeLogger.shared.log(message: "AppDelegate::removeAppBadger")
if #available(iOS 16.0, *) {
UNUserNotificationCenter.current().setBadgeCount(0)
} else {
UIApplication.shared.applicationIconBadgeNumber = 0
}
}
private func updateApplicationStateInUserDefaults(_ appIsActive: Bool) {
let appGroupId = (Bundle.main.object(forInfoDictionaryKey: "AppGroupId") as? String) ?? "group.\(Bundle.main.bundleIdentifier!)"
let userDefaults = UserDefaults(suiteName: appGroupId)
userDefaults?.set(appIsActive, forKey: CoreUtils.APPLICATION_STATE)
}
}
+3 -3
View File
@@ -292,11 +292,11 @@ packages:
dependency: "direct main"
description:
path: "."
ref: master
resolved-ref: d39739e8e9a43bba2c6ea6c885653c615e114e07
ref: "hotfix/migrate-ios-26"
resolved-ref: "61ceb0751a564f8d687cb51bb4d6298737e2b9dc"
url: "https://github.com/linagora/flutter_contacts.git"
source: git
version: "0.6.3"
version: "0.6.4"
convert:
dependency: transitive
description:
+2 -1
View File
@@ -76,10 +76,11 @@ dependencies:
url: https://github.com/linagora/jmap-dart-client.git
ref: main
# TODO: Revert when https://github.com/linagora/flutter_contacts/pull/13 is merged
contacts_service:
git:
url: https://github.com/linagora/flutter_contacts.git
ref: master
ref: hotfix/migrate-ios-26
receive_sharing_intent:
git: