Manos Chorianopoulos

push crash fix

......@@ -292,13 +292,46 @@ static const char* jailbreak_apps[] =
switch (state) {
case WLApplicationStateActive:
{
UIAlertView *alert = [[UIAlertView alloc] init];
[alert setTitle:[[[userInfo objectForKey:@"aps"] objectForKey:@"alert"] objectForKey:@"title"]];
[alert setMessage:[[[userInfo objectForKey:@"aps"] objectForKey:@"alert"] objectForKey:@"body"]];
[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"] objectForKey:@"title"]];
// [alert setMessage:[[[userInfo objectForKey:@"aps"] objectForKey:@"alert"] objectForKey:@"body"]];
// [alert addButtonWithTitle:NSLocalizedString(@"Close", @"Warply")];
// [alert addButtonWithTitle:NSLocalizedString(@"View", @"Warply")];
// [alert setDelegate:self];
// [alert show];
// ==============
NSDictionary *apsInfo = [userInfo objectForKey:@"aps"];
NSDictionary *alertInfo = [apsInfo objectForKey:@"alert"];
NSString *title = [alertInfo objectForKey:@"title"];
NSString *body = [alertInfo objectForKey:@"body"];
UIAlertController *alertController = [UIAlertController alertControllerWithTitle:title
message:body
preferredStyle:UIAlertControllerStyleAlert];
UIAlertAction *closeAction = [UIAlertAction actionWithTitle:NSLocalizedString(@"Close", @"Warply")
style:UIAlertActionStyleCancel
handler:^(UIAlertAction *action) {
// Handle close action if needed
}];
UIAlertAction *viewAction = [UIAlertAction actionWithTitle:NSLocalizedString(@"View", @"Warply")
style:UIAlertActionStyleDefault
handler:^(UIAlertAction *action) {
// Handle view action if needed
}];
[alertController addAction:closeAction];
[alertController addAction:viewAction];
// Get the application's root view controller
UIViewController *rootViewController = [UIApplication sharedApplication].delegate.window.rootViewController;
// Present the alert in the root view controller
[rootViewController presentViewController:alertController animated:YES completion:nil];
// ==============
// UIAlertController * alert = [UIAlertController alertControllerWithTitle:[[userInfo objectForKey:@"aps"] objectForKey:@"alert"] message:@"" preferredStyle:UIAlertControllerStyleAlert];
......@@ -387,38 +420,72 @@ static const char* jailbreak_apps[] =
switch (state) {
case WLApplicationStateActive:
{
// UIAlertController * alert = [UIAlertController alertControllerWithTitle:[[userInfo objectForKey:@"aps"] objectForKey:@"alert"] message:@"" preferredStyle:UIAlertControllerStyleAlert];
// 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];
// UIAlertAction* yesButton = [UIAlertAction
// actionWithTitle:NSLocalizedString(@"Close", @"Warply")
// style:UIAlertActionStyleDefault
// handler:^(UIAlertAction * action) {
// //Handle your yes please button action here
// }];
// ==============
// UIAlertView *alert = [[UIAlertView alloc] init];
// [alert setTitle:[[[userInfo objectForKey:@"aps"] objectForKey:@"alert"] objectForKey:@"title"]];
// [alert setMessage:[[[userInfo objectForKey:@"aps"] objectForKey:@"alert"] objectForKey:@"body"]];
// [alert addButtonWithTitle:NSLocalizedString(@"Close", @"Warply")];
// [alert addButtonWithTitle:NSLocalizedString(@"View", @"Warply")];
// [alert setDelegate:self];
// [alert show];
// ==============
NSDictionary *apsInfo = [userInfo objectForKey:@"aps"];
NSDictionary *alertInfo = [apsInfo objectForKey:@"alert"];
NSString *title = [alertInfo objectForKey:@"title"];
NSString *body = [alertInfo objectForKey:@"body"];
UIAlertController *alertController = [UIAlertController alertControllerWithTitle:title
message:body
preferredStyle:UIAlertControllerStyleAlert];
UIAlertAction *closeAction = [UIAlertAction actionWithTitle:NSLocalizedString(@"Close", @"Warply")
style:UIAlertActionStyleCancel
handler:^(UIAlertAction *action) {
// Handle close action if needed
}];
// UIAlertAction* noButton = [UIAlertAction
// actionWithTitle:NSLocalizedString(@"View", @"Warply")
// style:UIAlertActionStyleDefault
// handler:^(UIAlertAction * action) {
// //Handle no, thanks button
// }];
UIAlertAction *viewAction = [UIAlertAction actionWithTitle:NSLocalizedString(@"View", @"Warply")
style:UIAlertActionStyleDefault
handler:^(UIAlertAction *action) {
// Handle view action if needed
}];
// [alert addAction:yesButton];
// [alert addAction:noButton];
[alertController addAction:closeAction];
[alertController addAction:viewAction];
// 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];
// Get the application's root view controller
UIViewController *rootViewController = [UIApplication sharedApplication].delegate.window.rootViewController;
// Present the alert in the root view controller
[rootViewController presentViewController:alertController animated:YES completion:nil];
// ==============
UIAlertView *alert = [[UIAlertView alloc] init];
[alert setTitle:[[[userInfo objectForKey:@"aps"] objectForKey:@"alert"] objectForKey:@"title"]];
[alert setMessage:[[[userInfo objectForKey:@"aps"] objectForKey:@"alert"] objectForKey:@"body"]];
[alert addButtonWithTitle:NSLocalizedString(@"Close", @"Warply")];
[alert addButtonWithTitle:NSLocalizedString(@"View", @"Warply")];
[alert setDelegate:self];
[alert show];
self.pendingItem = inboxItem;
break;
......@@ -508,13 +575,45 @@ static const char* jailbreak_apps[] =
// [alertWindow makeKeyAndVisible];
// [alertWindow.rootViewController presentViewController:alert animated:YES completion:nil];
UIAlertView *alert = [[UIAlertView alloc] init];
[alert setTitle:[[[userInfo objectForKey:@"aps"] objectForKey:@"alert"] objectForKey:@"title"]];
[alert setMessage:[[[userInfo objectForKey:@"aps"] objectForKey:@"alert"] objectForKey:@"body"]];
[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"] objectForKey:@"title"]];
// [alert setMessage:[[[userInfo objectForKey:@"aps"] objectForKey:@"alert"] objectForKey:@"body"]];
// [alert addButtonWithTitle:NSLocalizedString(@"Close", @"Warply")];
// [alert addButtonWithTitle:NSLocalizedString(@"View", @"Warply")];
// [alert setDelegate:self];
// [alert show];
// ==============
NSDictionary *apsInfo = [userInfo objectForKey:@"aps"];
NSDictionary *alertInfo = [apsInfo objectForKey:@"alert"];
NSString *title = [alertInfo objectForKey:@"title"];
NSString *body = [alertInfo objectForKey:@"body"];
UIAlertController *alertController = [UIAlertController alertControllerWithTitle:title
message:body
preferredStyle:UIAlertControllerStyleAlert];
UIAlertAction *closeAction = [UIAlertAction actionWithTitle:NSLocalizedString(@"Close", @"Warply")
style:UIAlertActionStyleCancel
handler:^(UIAlertAction *action) {
// Handle close action if needed
}];
UIAlertAction *viewAction = [UIAlertAction actionWithTitle:NSLocalizedString(@"View", @"Warply")
style:UIAlertActionStyleDefault
handler:^(UIAlertAction *action) {
// Handle view action if needed
}];
[alertController addAction:closeAction];
[alertController addAction:viewAction];
// Get the application's root view controller
UIViewController *rootViewController = [UIApplication sharedApplication].delegate.window.rootViewController;
// Present the alert in the root view controller
[rootViewController presentViewController:alertController animated:YES completion:nil];
// ==============
self.pendingItem = inboxItem;
break;
......@@ -909,8 +1008,26 @@ static const char* jailbreak_apps[] =
UIViewController *existingModalController = [[UIApplication sharedApplication].delegate.window.rootViewController topModalViewController];
if (existingModalController == nil) {
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"WL_Warning" message:@"You have to set the mainWindow.rootViewController in order for offer views to be presented properly." delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil];
[alert show];
// UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"WL_Warning" message:@"You have to set the mainWindow.rootViewController in order for offer views to be presented properly." delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil];
// [alert show];
// ================
UIAlertController *alertController = [UIAlertController alertControllerWithTitle:@"WL_Warning"
message:@"You have to set the mainWindow.rootViewController in order for offer views to be presented properly."
preferredStyle:UIAlertControllerStyleAlert];
UIAlertAction *okAction = [UIAlertAction actionWithTitle:@"OK"
style:UIAlertActionStyleDefault
handler:nil];
[alertController addAction:okAction];
// Get the application's root view controller
UIViewController *rootViewController = [UIApplication sharedApplication].delegate.window.rootViewController;
// Present the alert in the root view controller
[rootViewController presentViewController:alertController animated:YES completion:nil];
// ================
// UIAlertController * alert = [UIAlertController alertControllerWithTitle:@"WL_Warning" message:@"You have to set the mainWindow.rootViewController in order for offer views to be presented properly." preferredStyle:UIAlertControllerStyleAlert];
......