UnbluUiApplicationDelegate
@objc
open class UnbluUiApplicationDelegate : UIResponder, UIApplicationDelegate, MessagingDelegate
Basic implementation of UIApplicationDelegate. It is needed to intercept some application callbacks, which are not available through some other api (e.g. NotificationCenter). Always call the super implementation of the delegate first, before handling the functions by your own.
Do not use this delegate if you do NOT want to use Firebase Cloud Messaging (FCM).
-
Calls FirebaseApp.configure and Messaging.messaging().delegate = self and checks if there was an initial notification from which the app was started. Please ensure to call this super implementation from within your AppDelegate
Declaration
Swift
open func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey : Any]?) -> Bool
-
See original documentation from apple for didFailToRegisterForRemoteNotificationsWithError. If you override this function, please call super implementation first.
Declaration
Swift
open func application(_ application: UIApplication, didFailToRegisterForRemoteNotificationsWithError error: Error)
-
Called when received a remote notification. Will call on_application(_ application: UIApplication, didReceiveRemoteNotification userInfo: [AnyHashable: Any]) if it was not an unblu notification
Declaration
Swift
public func application(_ application: UIApplication, didReceiveRemoteNotification userInfo: [AnyHashable : Any])
-
Called when received a remote notification. Will call on_application(_ application: UIApplication, didReceiveRemoteNotification userInfo: [AnyHashable: Any], fetchCompletionHandler completionHandler: @escaping (UIBackgroundFetchResult) -> Void) if it was not an unblu notification
Declaration
Swift
public func application(_ application: UIApplication, didReceiveRemoteNotification userInfo: [AnyHashable : Any], fetchCompletionHandler completionHandler: @escaping (UIBackgroundFetchResult) -> Void)
-
Called instead of the original didReceiveRemoteNotification function as unblu needs to make sure it is called
Declaration
Swift
open func on_application(_ application: UIApplication, didReceiveRemoteNotification userInfo: [AnyHashable : Any])
-
Called instead of the original didReceiveRemoteNotification function as unblu needs to make sure it is called
Declaration
Swift
open func on_application(_ application: UIApplication, didReceiveRemoteNotification userInfo: [AnyHashable : Any], fetchCompletionHandler completionHandler: @escaping (UIBackgroundFetchResult) -> Void)
-
Called when received the FCM token from the device. Will always call on_messaging(_ messaging: Messaging, didReceiveRegistrationToken fcmToken: String)
Declaration
Swift
public func messaging(_ messaging: Messaging, didReceiveRegistrationToken fcmToken: String)
-
Called by original didReceive function as unblu needs to make sure it is called
Declaration
Swift
@available(*, deprecated, message: "Remote notifications will no longer be delivered here. To receive remote notification updates, override the 'on_application' methods of this class related to receiving remote notifications.") open func on_messaging(_ messaging: Messaging, didReceive remoteMessage: MessagingRemoteMessage)
-
Called by original didReceiveRegistrationToken function as unblu needs to make sure it is called
Declaration
Swift
open func on_messaging(_ messaging: Messaging, didReceiveRegistrationToken fcmToken: String)