Not getting response in onMessage listener because of using smart_push sdk in flutter ios

139 views
Skip to first unread message

Prachi Sav

unread,
Nov 9, 2023, 10:05:04 AM11/9/23
to Firebase Google Group
After adding samrt push sdk in AppDeligate file of flutter IOS i am not able to listen callback onMessage listener.

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?

Arthur Thompson

unread,
Nov 9, 2023, 7:09:32 PM11/9/23
to fireba...@googlegroups.com
It looks like you are directly updating the iOS app within your Flutter app to use SmartPush. Have you tried their Flutter plugin?

--
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.
Reply all
Reply to author
Forward
0 new messages