3.4 Implementación en AppDelegate
Puedes verlo en nuestro vídeo tutorial o leer las instrucciones más abajo:
https://youtu.be/qmhzsSb9VXA
Modifica el fichero AppDelegate para importar el SDK y sobreescribir los siguientes métodos:
import Indigitall
func application(_ application: UIApplication,
didRegisterForRemoteNotificationsWithDeviceToken deviceToken: Data) {
Indigitall.set(deviceToken)
}
func application(_ application: UIApplication, didReceiveRemoteNotification data:
[AnyHashable : Any]) {
Indigitall.handle(notification: data)
}
func application(_ application: UIApplication, handleActionWithIdentifier identifier: String?,
forRemoteNotification userInfo: [AnyHashable : Any], completionHandler: @escaping () ->
Void) {
Indigitall.handle(notification: userInfo, identifier: identifier)
}
func application(_ application: UIApplication, didReceiveRemoteNotification userInfo:
[AnyHashable : Any], fetchCompletionHandler completionHandler: @escaping
(UIBackgroundFetchResult) -> Void) {
Indigitall.handle(notification: userInfo)
completionHandler(.newData)
}
func application(_ application: UIApplication, performFetchWithCompletionHandler
completionHandler: @escaping (UIBackgroundFetchResult) -> Void) {
Indigitall.performFetchWithCompletionHandler(completionHandler: completionHandler)
}