Skip to content

Commit d814844

Browse files
committed
InApp load update
1 parent ac1c72b commit d814844

File tree

2 files changed

+14
-9
lines changed

2 files changed

+14
-9
lines changed

ExponeaSDK/ExponeaSDK/Classes/ExponeaInternal.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,8 @@ public class ExponeaInternal: ExponeaType {
266266
repository: repository,
267267
customerIdentifiedHandler: { [weak self] in
268268
// reload in-app messages once customer identification is flushed - user may have been merged
269-
guard let inAppContentBlocksManager = self?.inAppContentBlocksManager else { return }
269+
guard let trackingManager = self?.trackingManager,
270+
let inAppContentBlocksManager = self?.inAppContentBlocksManager else { return }
270271
if let placeholders = configuration.inAppContentBlocksPlaceholders {
271272
inAppContentBlocksManager.loadInAppContentBlockMessages {
272273
inAppContentBlocksManager.prefetchPlaceholdersWithIds(ids: placeholders)

ExponeaSDK/ExponeaSDK/Classes/Tracking/TrackingManager.swift

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -210,15 +210,19 @@ extension TrackingManager: TrackingManagerType {
210210
for project in projects {
211211
if type == .identifyCustomer {
212212
inAppMessageManager?.pendingShowRequests.removeAll()
213-
}
214-
switch Exponea.shared.flushingMode {
215-
case .immediate:
216-
try? self.storeTrackEvent(of: type, with: payload, trackingAllowed, within: project)
217-
Exponea.shared.flushingManager?.inAppRefreshCallback = {
218-
Exponea.shared.flushingManager?.inAppRefreshCallback = nil
219-
self.onEventCallback(type, payload)
213+
switch Exponea.shared.flushingMode {
214+
case .immediate:
215+
Exponea.shared.flushingManager?.inAppRefreshCallback = {
216+
Exponea.shared.flushingManager?.inAppRefreshCallback = nil
217+
try? self.storeTrackEvent(of: type, with: payload, trackingAllowed, within: project)
218+
self.onEventCallback(type, payload)
219+
}
220+
Exponea.shared.flushingManager?.flushData()
221+
default:
222+
try storeTrackEvent(of: type, with: payload, trackingAllowed, within: project)
223+
onEventCallback(type, payload)
220224
}
221-
default:
225+
} else {
222226
try storeTrackEvent(of: type, with: payload, trackingAllowed, within: project)
223227
onEventCallback(type, payload)
224228
}

0 commit comments

Comments
 (0)