i’ve create flutter challenge. an i already do on iphone 15 (17.4) emulator on mac. however, after i do archives and construct the ios installer (.ipa) and set up on my iphone 13 (17.6) is black display screen after splash display screen. and that is my code for appdelegate
import UIKit
import Flutter
import Firebase
import UserNotifications
@foremost
@objc class AppDelegate: FlutterAppDelegate, MessagingDelegate {
override func software(
_ software: UIApplication,
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
) -> Bool {
FirebaseApp.configure()
let flutterEngine = FlutterEngine(title: "my flutter engine")
flutterEngine.run()
GeneratedPluginRegistrant.register(with: flutterEngine)
// Arrange push notifications
UNUserNotificationCenter.present().delegate = self
Messaging.messaging().delegate = self
let authOptions: UNAuthorizationOptions = [.alert, .badge, .sound]
UNUserNotificationCenter.present().requestAuthorization(
choices: authOptions
) { granted, error in
if let error = error {
print("Error requesting notification authorization: (error)")
} else {
print("Notification authorization granted: (granted)")
}
}
software.registerForRemoteNotifications()
// Arrange the foundation view controller
window = UIWindow(body: UIScreen.foremost.bounds)
let flutterViewController = FlutterViewController(engine: flutterEngine, nibName: nil, bundle: nil)
window?.rootViewController = flutterViewController
window?.makeKeyAndVisible()
return tremendous.software(software, didFinishLaunchingWithOptions: launchOptions)
}
// Deal with incoming notifications
override func userNotificationCenter(_ heart: UNUserNotificationCenter, didReceive response: UNNotificationResponse, withCompletionHandler completionHandler: @escaping () -> Void) {
let userInfo = response.notification.request.content material.userInfo
Messaging.messaging().appDidReceiveMessage(userInfo)
completionHandler()
}
override func userNotificationCenter(_ heart: UNUserNotificationCenter, willPresent notification: UNNotification, withCompletionHandler completionHandler: @escaping (UNNotificationPresentationOptions) -> Void) {
let userInfo = notification.request.content material.userInfo
Messaging.messaging().appDidReceiveMessage(userInfo)
completionHandler([.alert, .badge, .sound])
}
// Deal with registration for distant notifications
override func software(_ software: UIApplication, didRegisterForRemoteNotificationsWithDeviceToken deviceToken: Information) {
Messaging.messaging().apnsToken = deviceToken
}
// Deal with receiving registration token
func messaging(_ messaging: Messaging, didReceiveRegistrationToken fcmToken: String?) {
print("FCM registration token: (String(describing: fcmToken))")
// You possibly can ship the token to your server or deal with it as wanted
}
}
i am caught on this course of. and i do not know what’s the error on my system