TF-1861 Config worker manager on iOS
(cherry picked from commit a71422861efda154a79cc6c11d6fe190a88710dc)
This commit is contained in:
@@ -3,23 +3,32 @@ import Flutter
|
|||||||
import flutter_downloader
|
import flutter_downloader
|
||||||
import receive_sharing_intent
|
import receive_sharing_intent
|
||||||
import flutter_local_notifications
|
import flutter_local_notifications
|
||||||
|
import workmanager
|
||||||
|
|
||||||
@UIApplicationMain
|
@UIApplicationMain
|
||||||
@objc class AppDelegate: FlutterAppDelegate {
|
@objc class AppDelegate: FlutterAppDelegate {
|
||||||
|
|
||||||
|
/// Registers all pubspec-referenced Flutter plugins in the given registry.
|
||||||
|
static func registerPlugins(with registry: FlutterPluginRegistry) {
|
||||||
|
GeneratedPluginRegistrant.register(with: registry)
|
||||||
|
}
|
||||||
|
|
||||||
override func application(
|
override func application(
|
||||||
_ application: UIApplication,
|
_ application: UIApplication,
|
||||||
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
|
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
|
||||||
) -> Bool {
|
) -> Bool {
|
||||||
|
/// Register the app's plugins in the context of a normal run
|
||||||
|
AppDelegate.registerPlugins(with: self)
|
||||||
|
|
||||||
FlutterLocalNotificationsPlugin.setPluginRegistrantCallback { (registry) in
|
|
||||||
GeneratedPluginRegistrant.register(with: registry)
|
|
||||||
}
|
|
||||||
|
|
||||||
if #available(iOS 10.0, *) {
|
if #available(iOS 10.0, *) {
|
||||||
UNUserNotificationCenter.current().delegate = self as UNUserNotificationCenterDelegate
|
UNUserNotificationCenter.current().delegate = self as UNUserNotificationCenterDelegate
|
||||||
}
|
}
|
||||||
|
|
||||||
GeneratedPluginRegistrant.register(with: self)
|
UIApplication.shared.setMinimumBackgroundFetchInterval(TimeInterval(60*15))
|
||||||
|
|
||||||
|
FlutterLocalNotificationsPlugin.setPluginRegistrantCallback { registry in
|
||||||
|
AppDelegate.registerPlugins(with: registry)
|
||||||
|
}
|
||||||
|
|
||||||
FlutterDownloaderPlugin.setPluginRegistrantCallback { registry in
|
FlutterDownloaderPlugin.setPluginRegistrantCallback { registry in
|
||||||
if (!registry.hasPlugin("FlutterDownloaderPlugin")) {
|
if (!registry.hasPlugin("FlutterDownloaderPlugin")) {
|
||||||
@@ -32,12 +41,18 @@ import flutter_local_notifications
|
|||||||
if url.scheme == "mailto" {
|
if url.scheme == "mailto" {
|
||||||
if let url = handleEmailAndress(open: url) {
|
if let url = handleEmailAndress(open: url) {
|
||||||
let corrected = launchOptions!.map { (key, value) in key != .url ? (key, value) : (key, url) }
|
let corrected = launchOptions!.map { (key, value) in key != .url ? (key, value) : (key, url) }
|
||||||
|
|
||||||
return sharingIntent.application(application, didFinishLaunchingWithOptions: Dictionary(uniqueKeysWithValues: corrected))
|
return sharingIntent.application(application, didFinishLaunchingWithOptions: Dictionary(uniqueKeysWithValues: corrected))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
WorkmanagerPlugin.setPluginRegistrantCallback { registry in
|
||||||
|
AppDelegate.registerPlugins(with: registry)
|
||||||
|
}
|
||||||
|
|
||||||
|
WorkmanagerPlugin.registerTask(withIdentifier: "com.linagora.ios.teammail.sendingQueue")
|
||||||
|
|
||||||
return super.application(application, didFinishLaunchingWithOptions: launchOptions)
|
return super.application(application, didFinishLaunchingWithOptions: launchOptions)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -61,8 +61,13 @@
|
|||||||
<key>UIBackgroundModes</key>
|
<key>UIBackgroundModes</key>
|
||||||
<array>
|
<array>
|
||||||
<string>fetch</string>
|
<string>fetch</string>
|
||||||
<string>remote-notification</string>
|
<string>remote-notification</string>
|
||||||
|
<string>processing</string>
|
||||||
</array>
|
</array>
|
||||||
|
<key>BGTaskSchedulerPermittedIdentifiers</key>
|
||||||
|
<array>
|
||||||
|
<string>com.linagora.ios.teammail.sendingQueue</string>
|
||||||
|
</array>
|
||||||
<key>UILaunchStoryboardName</key>
|
<key>UILaunchStoryboardName</key>
|
||||||
<string>LaunchScreen</string>
|
<string>LaunchScreen</string>
|
||||||
<key>UIMainStoryboardFile</key>
|
<key>UIMainStoryboardFile</key>
|
||||||
|
|||||||
Reference in New Issue
Block a user