Skip to content

Commit e0d026e

Browse files
committed
refactor: simplify attribution info handling and improve error reporting in RNIterableAPI
1 parent 3e252ee commit e0d026e

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

ios/RNIterableAPI/ReactIterableAPI.swift

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -159,10 +159,6 @@ import React
159159
@objc(setAttributionInfo:)
160160
public func setAttributionInfo(attributionInfo dict: NSDictionary?) {
161161
ITBInfo()
162-
guard let dict = dict else {
163-
IterableAPI.attributionInfo = nil
164-
return
165-
}
166162
guard let swiftDict = dict as? [AnyHashable: Any] else {
167163
IterableAPI.attributionInfo = nil
168164
return
@@ -377,6 +373,7 @@ import React
377373
ITBInfo()
378374
guard let message = IterableAPI.inAppManager.getMessage(withId: messageId) else {
379375
ITBError("Could not find message with id: \(messageId)")
376+
rejecter("", "Could not find message with id: \(messageId)", NSError(domain: "", code: 0, userInfo: nil))
380377
return
381378
}
382379
IterableAPI.inAppManager.show(message: message, consume: consume) { (url) in
@@ -391,6 +388,7 @@ import React
391388
ITBInfo()
392389
guard let message = IterableAPI.inAppManager.getMessage(withId: messageId) else {
393390
ITBError("Could not find message with id: \(messageId)")
391+
rejecter("", "Could not find message with id: \(messageId)", NSError(domain: "", code: 0, userInfo: nil))
394392
return
395393
}
396394
if let inAppDeleteSource = InAppDeleteSource.from(number: sourceNumber as NSNumber) {

0 commit comments

Comments
 (0)