Skip to content

Commit

Permalink
Pull request #65: Bugfix/ikresic MM-6331 flutter ios push notificatio…
Browse files Browse the repository at this point in the history
…n 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 <[email protected]>
Date:   Mon Apr 15 13:27:44 2024 +0200

    - updated targeted version

commit 4417eb7473a42baa7dc880eda6d40145e69e38d1
Author: ikresic <[email protected]>
Date:   Mon Apr 15 13:23:27 2024 +0200

    - added MM_MTMessage dictionary to SDK side
  • Loading branch information
ikresicc committed Apr 18, 2024
1 parent 7d50445 commit e55a593
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 31 deletions.
4 changes: 2 additions & 2 deletions ios/Classes/MobileMessagingEventsManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
25 changes: 1 addition & 24 deletions ios/Classes/MobileMessagingUtils.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
}
}
Expand Down
10 changes: 5 additions & 5 deletions ios/infobip_mobilemessaging.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -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'

Expand Down

0 comments on commit e55a593

Please sign in to comment.