Manos Chorianopoulos

fix alertview at push manager

......@@ -256,12 +256,37 @@ static const char* jailbreak_apps[] =
switch (state) {
case WLApplicationStateActive:
{
UIAlertView *alert = [[UIAlertView alloc] init];
[alert setTitle:[[userInfo objectForKey:@"aps"] objectForKey:@"alert"]];
[alert addButtonWithTitle:NSLocalizedString(@"Close", @"Warply")];
[alert addButtonWithTitle:NSLocalizedString(@"View", @"Warply")];
[alert setDelegate:self];
[alert show];
// UIAlertView *alert = [[UIAlertView alloc] init];
// [alert setTitle:[[userInfo objectForKey:@"aps"] objectForKey:@"alert"]];
// [alert addButtonWithTitle:NSLocalizedString(@"Close", @"Warply")];
// [alert addButtonWithTitle:NSLocalizedString(@"View", @"Warply")];
// [alert setDelegate:self];
// [alert show];
UIAlertController * alert = [UIAlertController alertControllerWithTitle:[[userInfo objectForKey:@"aps"] objectForKey:@"alert"] message:@"" preferredStyle:UIAlertControllerStyleAlert];
UIAlertAction* yesButton = [UIAlertAction
actionWithTitle:NSLocalizedString(@"Close", @"Warply")
style:UIAlertActionStyleDefault
handler:^(UIAlertAction * action) {
//Handle your yes please button action here
}];
UIAlertAction* noButton = [UIAlertAction
actionWithTitle:NSLocalizedString(@"View", @"Warply")
style:UIAlertActionStyleDefault
handler:^(UIAlertAction * action) {
//Handle no, thanks button
}];
[alert addAction:yesButton];
[alert addAction:noButton];
UIWindow *alertWindow = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];
alertWindow.rootViewController = [[UIViewController alloc] init];
alertWindow.windowLevel = UIWindowLevelAlert + 1;
[alertWindow makeKeyAndVisible];
[alertWindow.rootViewController presentViewController:alert animated:YES completion:nil];
self.pendingItem = inboxItem;
break;
......