diff --git a/Sources/Deskpro.swift b/Sources/Deskpro.swift index aa37133..6f60773 100644 --- a/Sources/Deskpro.swift +++ b/Sources/Deskpro.swift @@ -96,14 +96,17 @@ public final class DeskPro: Messenger { /// /// This method examines the provided push notification data to determine whether it is intended for the DeskPro SDK. /// - /// - Parameter pushNotification: The push notification data to be analyzed. + /// - Parameter data: The push notification data to be analyzed. /// /// - Returns: `true` if the push notification is related to DeskPro; `false` otherwise. /// /// - Tag: isDeskProPushNotification - public final func isDeskProPushNotification(pushNotification: PushNotificationData) -> Bool { - // TODO: Not yet implemented - return true + public final func isDeskProPushNotification(data: [AnyHashable: Any]) -> Bool { + if let issuer = data["issuer"] as? String { + return issuer == "deskpro-messenger" + } else { + return false + } } /// Handles the incoming push notification data if it is related to DeskPro. diff --git a/Sources/Messenger.swift b/Sources/Messenger.swift index 3e42692..bb5f955 100644 --- a/Sources/Messenger.swift +++ b/Sources/Messenger.swift @@ -52,12 +52,12 @@ protocol Messenger { /// /// This method examines the provided push notification data to determine whether it is intended for the DeskPro SDK. /// - /// - Parameter pushNotification: The push notification data to be analyzed. + /// - Parameter data: The push notification data to be analyzed. /// /// - Returns: `true` if the push notification is related to DeskPro; `false` otherwise. /// /// - Tag: isDeskProPushNotification - func isDeskProPushNotification(pushNotification: PushNotificationData) -> Bool + func isDeskProPushNotification(data: [AnyHashable: Any]) -> Bool /// Handles the incoming push notification data if it is related to DeskPro. ///