Notifly 설정 추가

This commit is contained in:
Yu Sung
2025-03-12 16:05:08 +09:00
parent f9bad015a8
commit f22bc9d98d
10 changed files with 128 additions and 1 deletions

View File

@@ -7,6 +7,7 @@
import UIKit
import notifly_sdk
import AppsFlyerLib
import FBSDKCoreKit
import FirebaseCore
@@ -19,6 +20,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey : Any]? = nil) -> Bool {
FirebaseApp.configure()
Notifly.initialize(projectId: NOTIFLY_PROJECT_ID, username: NOTIFLY_USERNAME, password: NOTIFLY_PASSWORD)
Messaging.messaging().delegate = self
// For iOS 10 display notification (sent via APNS)
@@ -56,9 +58,11 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
func application(_ application: UIApplication, didRegisterForRemoteNotificationsWithDeviceToken deviceToken: Data) {
UserDefaults.set(deviceToken, forKey: .devicePushToken)
Messaging.messaging().apnsToken = deviceToken
Notifly.application(application, didRegisterForRemoteNotificationsWithDeviceToken: deviceToken)
}
func application(_ application: UIApplication, didFailToRegisterForRemoteNotificationsWithError error: Error) {
Notifly.application(application, didFailToRegisterForRemoteNotificationsWithError: error)
}
func application(_ application: UIApplication, continue userActivity: NSUserActivity, restorationHandler: @escaping ([any UIUserActivityRestoring]?) -> Void) -> Bool {
@@ -164,6 +168,8 @@ extension AppDelegate : UNUserNotificationCenterDelegate {
// With swizzling disabled you must let Messaging know about the message, for Analytics
Messaging.messaging().appDidReceiveMessage(userInfo)
Notifly.userNotificationCenter(center, willPresent: notification, withCompletionHandler: completionHandler)
// ...
// Print full message.
@@ -180,6 +186,7 @@ extension AppDelegate : UNUserNotificationCenterDelegate {
// With swizzling disabled you must let Messaging know about the message, for Analytics
Messaging.messaging().appDidReceiveMessage(userInfo)
Notifly.userNotificationCenter(center, didReceive: response)
let roomIdString = userInfo["room_id"] as? String
let contentIdString = userInfo["content_id"] as? String