Skip to content

Commit cb58ec5

Browse files
authored
Merge pull request #1060 from OneSignal/fix/crashing_iams_with_tag_sub
Fix IAM Tag Sub crash when getTags returns after loading HTML
2 parents 236ecfc + 8656b2d commit cb58ec5

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

iOS_SDK/OneSignalSDK/Source/OSInAppMessageViewController.m

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -296,8 +296,10 @@ - (NSString *)setContentInsetsInHTML:(NSString *)html {
296296
- (void)setWaitForTags:(BOOL)waitForTags {
297297
_waitForTags = waitForTags;
298298
if (!waitForTags && self.pendingHTMLContent) {
299-
[self.messageView loadedHtmlContent:self.pendingHTMLContent withBaseURL:[NSURL URLWithString:OS_IAM_WEBVIEW_BASE_URL]];
300-
self.pendingHTMLContent = nil;
299+
dispatch_async(dispatch_get_main_queue(), ^{
300+
[self.messageView loadedHtmlContent:self.pendingHTMLContent withBaseURL:[NSURL URLWithString:OS_IAM_WEBVIEW_BASE_URL]];
301+
self.pendingHTMLContent = nil;
302+
});
301303
}
302304
}
303305

0 commit comments

Comments
 (0)