Skip to content

Commit b7dd0e8

Browse files
Add method getMessage(withId id: String) to IterableInAppManagerProtocol
1 parent 2596c59 commit b7dd0e8

File tree

3 files changed

+12
-0
lines changed

3 files changed

+12
-0
lines changed

swift-sdk/Internal/EmptyInAppManager.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,10 @@ class EmptyInAppManager: IterableInternalInAppManagerProtocol {
3838

3939
func set(read _: Bool, forMessage _: IterableInAppMessage) {}
4040

41+
func getMessage(withId _: String) -> IterableInAppMessage? {
42+
return nil
43+
}
44+
4145
func getUnreadInboxMessagesCount() -> Int {
4246
return 0
4347
}

swift-sdk/Internal/InAppManager.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,10 @@ class InAppManager: NSObject, IterableInternalInAppManagerProtocol {
182182
}
183183
}
184184

185+
func getMessage(withId id: String) -> IterableInAppMessage? {
186+
return messagesMap[id]
187+
}
188+
185189
func isOkToShowNow(message: IterableInAppMessage) -> Bool {
186190
guard message.didProcessTrigger == false else {
187191
ITBInfo("message with id: \(message.messageId) is already processed")

swift-sdk/IterableMessaging.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,10 @@ import UIKit
4848
/// - parameter read: Whether this inbox message was read
4949
/// - parameter message: The inbox message
5050
@objc(setRead:forMessage:) func set(read: Bool, forMessage message: IterableInAppMessage)
51+
52+
/// - parameter id: The id of the message
53+
/// - returns: IterableInAppMessage with the id, if it exists.
54+
@objc(getMessageWithId:) func getMessage(withId id: String) -> IterableInAppMessage?
5155
}
5256

5357
/// Iterable Notification names

0 commit comments

Comments
 (0)