Skip to content

Commit

Permalink
chore: Push ObjectiveC Wrappers
Browse files Browse the repository at this point in the history
  • Loading branch information
Ahmed-Ali committed Jun 23, 2024
1 parent 7fe98a0 commit 07a98fb
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 0 deletions.
25 changes: 25 additions & 0 deletions ios/apn/CioMessagingPush.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import Foundation
import CioMessagingPushAPN

@objc
public class CioMessagingPush : NSObject {

public override init() {
super.init()
}

@objc
public static func setup() {
MessagingPushAPN.initialize(withConfig: MessagingPushConfigBuilder().build())
}

@objc
public static func application(_ application: UIApplication, didRegisterForRemoteNotificationsWithDeviceToken deviceToken: Data) {
MessagingPush.shared.application(application, didRegisterForRemoteNotificationsWithDeviceToken: deviceToken)
}

@objc
public static func application(_ application: UIApplication, didFailToRegisterForRemoteNotificationsWithError error: Error) {
MessagingPush.shared.application(application, didFailToRegisterForRemoteNotificationsWithError: error)
}
}
26 changes: 26 additions & 0 deletions ios/fcm/CioMessagingPush.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import Foundation
import CioMessagingPushFCM
import FirebaseMessaging

@objc
public class CioMessagingPush : NSObject {

public override init() {
super.init()
}

@objc
public static func setup() {
MessagingPushFCM.initialize(withConfig: MessagingPushConfigBuilder().build())
}

@objc
public static func messaging(_ messaging: Messaging, didReceiveRegistrationToken fcmToken: String?) {
MessagingPush.shared.messaging(messaging, didReceiveRegistrationToken: fcmToken)
}

@objc
public static func application(_ application: UIApplication, didFailToRegisterForRemoteNotificationsWithError error: Error) {
MessagingPush.shared.application(application, didFailToRegisterForRemoteNotificationsWithError: error)
}
}

0 comments on commit 07a98fb

Please sign in to comment.