forked from organicmaps/organicmaps
[ios] Added ability to show banners on first launch.
This commit is contained in:
parent
e26c3f7a4b
commit
46359c6f1f
1 changed files with 15 additions and 4 deletions
|
@ -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];
|
||||
|
|
Loading…
Add table
Reference in a new issue