[ios] Added ability to show banners on first launch.

This commit is contained in:
Timur Bernikowich 2014-11-06 19:12:00 +03:00 committed by Alex Zolotarev
parent e26c3f7a4b
commit 46359c6f1f

View file

@ -42,6 +42,7 @@ NSString * const MWMProVersionPrefix = @"MWMPro";
self = [super init];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(applicationWillEnterForeground:) name:UIApplicationWillEnterForegroundNotification object:nil];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(appInfoSynced:) name:AppInfoSyncedNotification object:nil];
return self;
}
@ -142,13 +143,23 @@ NSString * const MWMProVersionPrefix = @"MWMPro";
- (void)applicationWillEnterForeground:(NSNotification *)notification
{
[self performAfterDelay:0.7 block:^{
for (NSString * messageName in [self.observers allKeys])
{
[self triggerMessage:messageName];
}
[self triggerAllMessages];
}];
}
- (void)appInfoSynced:(NSNotification *)notification
{
[self triggerAllMessages];
}
- (void)triggerAllMessages
{
for (NSString * messageName in [self.observers allKeys])
{
[self triggerMessage:messageName];
}
}
- (void)findVariantForMessage:(NSString *)messageName completion:(CompletionBlock)block
{
AppInfo * info = [AppInfo sharedInfo];