From e55a59388f411e96ef212aaad06fc46a0fc6f4f3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ivan=20Kre=C5=A1i=C4=87?= Date: Thu, 18 Apr 2024 11:55:10 +0000 Subject: [PATCH] Pull request #65: Bugfix/ikresic MM-6331 flutter ios push notification title isn t provided in the message dictionary Merge in MML/infobip-mobile-messaging-flutter from bugfix/ikresic-MM-6331-flutter-ios-push-notification-title-isn-t-provided-in-the-message-dictionary to main Squashed commit of the following: commit 218e5dd731f50e055a76537653c518619b4b352a Author: ikresic Date: Mon Apr 15 13:27:44 2024 +0200 - updated targeted version commit 4417eb7473a42baa7dc880eda6d40145e69e38d1 Author: ikresic Date: Mon Apr 15 13:23:27 2024 +0200 - added MM_MTMessage dictionary to SDK side --- .../MobileMessagingEventsManager.swift | 4 +-- ios/Classes/MobileMessagingUtils.swift | 25 +------------------ ios/infobip_mobilemessaging.podspec | 10 ++++---- 3 files changed, 8 insertions(+), 31 deletions(-) diff --git a/ios/Classes/MobileMessagingEventsManager.swift b/ios/Classes/MobileMessagingEventsManager.swift index 66d304f..37be458 100644 --- a/ios/Classes/MobileMessagingEventsManager.swift +++ b/ios/Classes/MobileMessagingEventsManager.swift @@ -79,7 +79,7 @@ class MobileMessagingEventsManager: NSObject, FlutterStreamHandler { case MMNotificationMessageReceived: eventName = EventName.messageReceived if let message = notification.userInfo?[MMNotificationKeyMessage] as? MM_MTMessage { - notificationResult = message.dictionary() + notificationResult = message.dictionaryRepresentation } case MMNotificationDeviceTokenReceived: eventName = EventName.tokenReceived @@ -99,7 +99,7 @@ class MobileMessagingEventsManager: NSObject, FlutterStreamHandler { case MMNotificationMessageTapped: eventName = EventName.notificationTapped if let message = notification.userInfo?[MMNotificationKeyMessage] as? MM_MTMessage { - notificationResult = message.dictionary() + notificationResult = message.dictionaryRepresentation } case MMNotificationActionTapped: eventName = EventName.actionTapped diff --git a/ios/Classes/MobileMessagingUtils.swift b/ios/Classes/MobileMessagingUtils.swift index af923a3..65c61b7 100644 --- a/ios/Classes/MobileMessagingUtils.swift +++ b/ios/Classes/MobileMessagingUtils.swift @@ -2,29 +2,6 @@ import Foundation import MobileMessaging extension MM_MTMessage { - override func dictionary() -> [String: Any] { - var result = [String: Any]() - result["messageId"] = messageId - result["body"] = text - result["sound"] = sound - result["silent"] = isSilent - result["receivedTimestamp"] = UInt64(sendDateTime * 1000) - result["customPayload"] = customPayload - result["originalPayload"] = originalPayload - result["contentUrl"] = contentUrl - result["seen"] = seenStatus != .NotSeen - result["seenDate"] = seenDate?.timeIntervalSince1970 - result["geo"] = isGeoMessage - result["chat"] = isChatMessage - result["browserUrl"] = browserUrl?.absoluteString - result["deeplink"] = deeplink?.absoluteString - result["webViewUrl"] = webViewUrl?.absoluteString - result["inAppOpenTitle"] = inAppOpenTitle - result["inAppDismissTitle"] = inAppDismissTitle - result["topic"] = topic - return result - } - var isGeoMessage: Bool { let geoAreasDicts = (originalPayload["internalData"] as? [String: Any])?["geo"] as? [[String: Any]] return geoAreasDicts != nil @@ -98,7 +75,7 @@ extension MMInbox { var result = [String: Any]() result["countTotal"] = countTotal result["countUnread"] = countUnread - result["messages"] = messages.map({ return $0.dictionary() }) + result["messages"] = messages.map({ return $0.dictionaryRepresentation }) return result } } diff --git a/ios/infobip_mobilemessaging.podspec b/ios/infobip_mobilemessaging.podspec index d00a130..8eb49d6 100644 --- a/ios/infobip_mobilemessaging.podspec +++ b/ios/infobip_mobilemessaging.podspec @@ -21,12 +21,12 @@ A new flutter plugin project. s.source = { :path => '.' } s.source_files = 'Classes/**/*' s.dependency 'Flutter' - s.dependency "MobileMessaging/Core", "12.4.1" - s.dependency "MobileMessaging/Geofencing", "12.4.1" - s.dependency "MobileMessaging/InAppChat", "12.4.1" - s.dependency "MobileMessaging/Inbox", "12.4.1" + s.dependency "MobileMessaging/Core", "12.6.2" + s.dependency "MobileMessaging/Geofencing", "12.6.2" + s.dependency "MobileMessaging/InAppChat", "12.6.2" + s.dependency "MobileMessaging/Inbox", "12.6.2" if defined?($WebRTCUIEnabled) - s.dependency "MobileMessaging/WebRTCUI", "12.4.1" + s.dependency "MobileMessaging/WebRTCUI", "12.6.2" end s.platform = :ios, '12.0'