Skip to content

Commit f96cc66

Browse files
author
Alexis Oyama
committed
fix(MessageTemplate): App Icon showing the popup twice
1 parent 0705c75 commit f96cc66

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

Leanplum-SDK/Classes/LPMessageTemplates.m

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1136,10 +1136,13 @@ - (void)setAlternateIconWithFilename:(NSString *)filename
11361136
}
11371137

11381138
[app setAlternateIconName:iconName completionHandler:^(NSError * _Nullable error) {
1139-
NSLog(@"Fail to change app icon: %@. Trying again.", error);
1140-
1139+
if (!error) {
1140+
return;
1141+
}
1142+
11411143
// Common failure is when setAlternateIconName: is called right upon start.
11421144
// Try again after 1 second.
1145+
NSLog(@"Fail to change app icon: %@. Trying again.", error);
11431146
dispatch_time_t dispatchTime = dispatch_time(DISPATCH_TIME_NOW, 1 * NSEC_PER_SEC);
11441147
dispatch_after(dispatchTime, dispatch_get_main_queue(), ^{
11451148
[[UIApplication sharedApplication] setAlternateIconName:iconName

0 commit comments

Comments
 (0)