MESSENGER-3681 Updated birthday banner for second anniversary campaign

This commit is contained in:
Arnfried Griesert
2022-11-16 13:32:04 +00:00
committed by Frank Rotermund
parent 5b0e259f78
commit 02a0b64ec6
14 changed files with 375 additions and 832 deletions
@@ -1054,6 +1054,30 @@
if ([BWIAnalytics.sharedTracker needsToShowPromt]) {
[self bwiShowMatomoInfoScreen];
}
if ([BWIBuildSettings.shared bwiShowHappyBirthdayCampaign]) {
[self showHappyBirthdayScreen];
}
}
- (void)showHappyBirthdayScreen {
MXSession *session = mxSessionArray.firstObject;
if (session) {
__block RiotSharedSettings *sharedSettings = [[RiotSharedSettings alloc] initWithSession:session];
NSString *identifier = [BWIBuildSettings.shared bwiHappyBirthdayCampaignIdentifier];
if( [sharedSettings happyBirthdayCampaignFor:identifier] ) {
UIViewController *controller = [HappyBirthdayViewController makeViewController] ;
controller.modalPresentationStyle = UIModalPresentationFullScreen;
[self presentViewController:controller animated:YES completion:nil];
[sharedSettings setHappyBirthdayCampaign:identifier
enabled:FALSE
success:^{
sharedSettings = nil;
} failure:^(NSError * _Nullable error) {
MXLogDebug(@"[HappyBirthdayCampaign] could not set flag in account data. Error: %@", error);
sharedSettings = nil;
}];
}
}
}
- (void) bwiCheckForPersonalNotesRoom {