Hi,
my Flutter App should received and show Push notifications even if my App is in Foreground and active.
If i register my Device with:
await Backendless.messaging.registerDevice( [‘default’] , null, _onPushMessageReceived ));
my _onPushMessageReceived get called and I can see the Push. So in general my Push chain works but I can’t configure my App that I get a native Forground Push.
My iOS App Delegate:
@UIApplicationMain
@objc class AppDelegate: FlutterAppDelegate {
override func application(
_ application: UIApplication,
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
) → Bool {
GeneratedPluginRegistrant.register(with: self)
if #available(iOS 10.0, *) {
let center = UNUserNotificationCenter.current()
center.delegate = self
center.requestAuthorization(options: [.alert, .badge, .sound]) { (granted, error) in
DispatchQueue.main.async {
UIApplication.shared.registerForRemoteNotifications()
}
}
} else {
let settings = UIUserNotificationSettings(types: [.alert, .badge, .sound], categories: nil)
UIApplication.shared.registerUserNotificationSettings(settings)
DispatchQueue.main.async {
UIApplication.shared.registerForRemoteNotifications()
}
}
if #available(iOS 10.0, *) {
UNUserNotificationCenter.current().delegate = self
}
return super.application(application, didFinishLaunchingWithOptions: launchOptions)
}
override func userNotificationCenter(_ center: UNUserNotificationCenter, willPresent notification: UNNotification, withCompletionHandler completionHandler: @escaping (UNNotificationPresentationOptions) -> Void) {
completionHandler([.banner, .badge, .sound])
}
}
So, is there a way to send the Push i received with _onPushMessageReceived back to iOS or a Config that my App never got the Push so that iOS handle everything like a Push if my App is in Background?
Regards,
Stephan