AppDelegate.swift
1.41 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
import UIKit
import Flutter
import flutter_downloader
import GoogleMaps
@main
@objc class AppDelegate: FlutterAppDelegate {
override func application(
_ application: UIApplication,
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
) -> Bool {
let controller = self.window.rootViewController as! FlutterViewController
let channel = FlutterMethodChannel.init(name: "com.naji/book", binaryMessenger: controller as! FlutterBinaryMessenger)
channel.setMethodCallHandler { (call, result) in
if call.method == "getIntent" {
// let para = call.arguments
// print(para!)
let userInfo = launchOptions?[UIApplication.LaunchOptionsKey.remoteNotification];
result(userInfo);
}else{
result(FlutterMethodNotImplemented)
}
}
GMSServices.provideAPIKey("AIzaSyDyfhPMoNzRZDc62Wc67Ksrm5m9p83Stv8")
GeneratedPluginRegistrant.register(with: self)
FlutterDownloaderPlugin.setPluginRegistrantCallback(registerPlugins)
return super.application(application, didFinishLaunchingWithOptions: launchOptions)
}
}
private func registerPlugins(registry: FlutterPluginRegistry) {
if (!registry.hasPlugin("FlutterDownloaderPlugin")) {
FlutterDownloaderPlugin.register(with: registry.registrar(forPlugin: "FlutterDownloaderPlugin")!)
}
}