/
Euromsg ve Firebase Ortak Kullanımı
Euromsg ve Firebase Ortak Kullanımı
Uygulamanızda Euromsg SDK’mızı ve Firebase’i ortak kullanmak isterseniz uygulamanız içerisinde Notification Service Extension classına aşağıdaki kodu eklemeniz yeterli.
import UserNotifications
import Euromsg
import FirebaseMessaging
class NotificationService: UNNotificationServiceExtension {
var contentHandler: ((UNNotificationContent) -> Void)?
var bestAttemptContent: UNMutableNotificationContent?
override func didReceive(_ request: UNNotificationRequest, withContentHandler contentHandler: @escaping (UNNotificationContent) -> Void) {
self.contentHandler = contentHandler
bestAttemptContent = (request.content.mutableCopy() as? UNMutableNotificationContent)
if (self.bestAttemptContent != nil) {
var userInfo = self.bestAttemptContent?.userInfo;
let emPushSp = userInfo?["emPushSp"];
if (emPushSp != nil) {
print("--RelatedDigital Push")
userInfo?.removeValue(forKey: "fcm_options")
self.bestAttemptContent?.userInfo = userInfo!
Euromsg.configure(appAlias: "EuromsgIOSTestDev", launchOptions: nil, enableLog: true, appGroupsKey: "group.com.relateddigital.EuromsgExample.relateddigital", deliveredBadge: false)
Euromsg.didReceive(bestAttemptContent, withContentHandler: contentHandler)
} else {
print("--Firebase Push")
Messaging.serviceExtension().populateNotificationContent(self.bestAttemptContent!, withContentHandler: contentHandler)
}
}
}
override func serviceExtensionTimeWillExpire() {
guard let contentHandler = self.contentHandler else {
return;
}
guard let bestAttemptContent = self.bestAttemptContent else {
return;
}
contentHandler(bestAttemptContent)
}
}
, multiple selections available,
Related content
Firebase Service Account Oluşturma
Firebase Service Account Oluşturma
More like this
iOS Target Aksiyonları
iOS Target Aksiyonları
More like this
SDK'da Bulunan Metotlar
SDK'da Bulunan Metotlar
More like this
Push Notification Modülü
Push Notification Modülü
More like this
Flutter - Push Notification
Flutter - Push Notification
More like this
Flutter - Payload
Flutter - Payload
More like this
Copyright 2020 Related Digital