Skip to content

Commit

Permalink
InApp load update
Browse files Browse the repository at this point in the history
  • Loading branch information
Ankmara committed Apr 26, 2024
1 parent ac1c72b commit d814844
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 9 deletions.
3 changes: 2 additions & 1 deletion ExponeaSDK/ExponeaSDK/Classes/ExponeaInternal.swift
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,8 @@ public class ExponeaInternal: ExponeaType {
repository: repository,
customerIdentifiedHandler: { [weak self] in
// reload in-app messages once customer identification is flushed - user may have been merged
guard let inAppContentBlocksManager = self?.inAppContentBlocksManager else { return }
guard let trackingManager = self?.trackingManager,
let inAppContentBlocksManager = self?.inAppContentBlocksManager else { return }
if let placeholders = configuration.inAppContentBlocksPlaceholders {
inAppContentBlocksManager.loadInAppContentBlockMessages {
inAppContentBlocksManager.prefetchPlaceholdersWithIds(ids: placeholders)
Expand Down
20 changes: 12 additions & 8 deletions ExponeaSDK/ExponeaSDK/Classes/Tracking/TrackingManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -210,15 +210,19 @@ extension TrackingManager: TrackingManagerType {
for project in projects {
if type == .identifyCustomer {
inAppMessageManager?.pendingShowRequests.removeAll()
}
switch Exponea.shared.flushingMode {
case .immediate:
try? self.storeTrackEvent(of: type, with: payload, trackingAllowed, within: project)
Exponea.shared.flushingManager?.inAppRefreshCallback = {
Exponea.shared.flushingManager?.inAppRefreshCallback = nil
self.onEventCallback(type, payload)
switch Exponea.shared.flushingMode {
case .immediate:
Exponea.shared.flushingManager?.inAppRefreshCallback = {
Exponea.shared.flushingManager?.inAppRefreshCallback = nil
try? self.storeTrackEvent(of: type, with: payload, trackingAllowed, within: project)
self.onEventCallback(type, payload)
}
Exponea.shared.flushingManager?.flushData()
default:
try storeTrackEvent(of: type, with: payload, trackingAllowed, within: project)
onEventCallback(type, payload)
}
default:
} else {
try storeTrackEvent(of: type, with: payload, trackingAllowed, within: project)
onEventCallback(type, payload)
}
Expand Down

0 comments on commit d814844

Please sign in to comment.