Skip to content

Commit e1d77be

Browse files
committed
Run engage on main thread when deferring
1 parent d14275a commit e1d77be

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

Apptentive/Apptentive/Engagement/Persistence/ApptentiveBackend+Engagement.m

+3-1
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,9 @@ - (BOOL)engageLocalEvent:(NSString *)event userInfo:(nullable NSDictionary *)use
9393
- (BOOL)engageCodePoint:(NSString *)codePoint fromInteraction:(nullable ApptentiveInteraction *)fromInteraction userInfo:(nullable NSDictionary *)userInfo customData:(nullable NSDictionary *)customData extendedData:(nullable NSArray *)extendedData fromViewController:(nullable UIViewController *)viewController {
9494
if (self.state != ApptentiveBackendStatePayloadDatabaseAvailable) {
9595
[self.operationQueue addOperationWithBlock:^{
96-
[self engageCodePoint:codePoint fromInteraction:fromInteraction userInfo:userInfo customData:customData extendedData:extendedData fromViewController:viewController];
96+
dispatch_async(dispatch_get_main_queue(), ^{
97+
[self engageCodePoint:codePoint fromInteraction:fromInteraction userInfo:userInfo customData:customData extendedData:extendedData fromViewController:viewController];
98+
});
9799
}];
98100

99101
ApptentiveLogInfo(@"Backend not ready. Deferring engagement of %@", codePoint);

0 commit comments

Comments
 (0)