Fixing singleton initialization

//FREEBIE
This commit is contained in:
Frederic Jacobs 2014-10-29 14:25:41 +01:00
parent efdda2f073
commit f8d201fc52

View File

@ -25,15 +25,21 @@
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{
sharedManager = [self new];
sharedManager.missingPermissionsAlertView = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"ACTION_REQUIRED_TITLE", @"")
message:NSLocalizedString(@"PUSH_SETTINGS_MESSAGE", @"")
delegate:nil
cancelButtonTitle:NSLocalizedString(@"OK", @"")
otherButtonTitles:nil, nil];
});
return sharedManager;
}
- (instancetype)init{
self = [super init];
if (self) {
self.missingPermissionsAlertView = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"ACTION_REQUIRED_TITLE", @"")
message:NSLocalizedString(@"PUSH_SETTINGS_MESSAGE", @"")
delegate:nil
cancelButtonTitle:NSLocalizedString(@"OK", @"")
otherButtonTitles:nil, nil];
}
return self;
}
- (void)verifyPushPermissions{
if (self.isMissingMandatoryNotificationTypes || self.needToRegisterForRemoteNotifications){