Code:
import UIKit import Flutter import smartech_base import Smartech import SmartPush
@UIApplicationMain @objc class AppDelegate: FlutterAppDelegate,SmartechDelegate { override func application( _ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? ) -> Bool { GeneratedPluginRegistrant.register (with: self)
Smartech.sharedInstance().initSDK(with: self,withLaunchOptions: launchOptions) Smartech.sharedInstance().setDebugLevel(.verbose) UNUserNotificationCenter.current().delegate = self SmartPush.sharedInstance().registerForPushNotificationWithDefaultAuthorizationOptions() Smartech.sharedInstance().trackAppInstallUpdateBySmartech() return super.application(application, didFinishLaunchingWithOptions: launchOptions)}
override func application(_ application: UIApplication, didRegisterForRemoteNotificationsWithDeviceToken deviceToken: Data) { SmartPush.sharedInstance().didRegisterForRemoteNotifications(withDeviceToken: deviceToken) }override func application(_ application: UIApplication, didFailToRegisterForRemoteNotificationsWithError error: Error) { SmartPush.sharedInstance().didFailToRegisterForRemoteNotificationsWithError(error) }
//MARK:- UNUserNotificationCenterDelegate Methods override func userNotificationCenter(_ center: UNUserNotificationCenter, willPresent notification: UNNotification, withCompletionHandler completionHandler: @escaping (UNNotificationPresentationOptions) -> Void) { SmartPush.sharedInstance().willPresentForegroundNotification(notification) completionHandler([.alert, .badge, .sound]) } override func userNotificationCenter(_ center: UNUserNotificationCenter, didReceive response: UNNotificationResponse, withCompletionHandler completionHandler: @escaping () -> Void) { SmartPush.sharedInstance().didReceive(response) completionHandler() } func handleDeeplinkAction(withURLString deeplinkURLString: String, andNotificationPayload notificationPayload: [AnyHashable : Any]?) { NSLog("SMTLogger Native method: \(deeplinkURLString)") SmartechBasePlugin.handleDeeplinkAction(deeplinkURLString, andCustomPayload:notificationPayload) }}
How can i make both working?
--
You received this message because you are subscribed to the Google Groups "Firebase Google Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to firebase-tal...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/firebase-talk/67ef584c-973d-44df-81c8-2185dc4ab535n%40googlegroups.com.