Manos Chorianopoulos

push Notifications fix

......@@ -43,6 +43,9 @@
NSString *_alert;
NSString *_sound;
NSUInteger _mutable_content;
NSString *_category;
// Test code for push
// NSString *_category;
// NSInteger _mutable_content;
......@@ -63,6 +66,9 @@
*/
@property (nonatomic, copy) NSString *sound;
@property (nonatomic) NSUInteger mutable_content;
@property (nonatomic, copy) NSString *category;
/*!
@methodgroup Initializing a WLAPSItem Object
*/
......
......@@ -52,9 +52,15 @@
if ([idx isKindOfClass:[NSNull class]] )
continue;
if ([key isEqualToString:@"mutable-content"]) {
[self setValue:idx forKey:@"mutable_content"];
} else {
[self setValue:idx forKey:key];
}
@catch (NSException *e) { WLLOG(@"%@: UnKnown Key:%@ - Value:%@", [e name], key, idx); }
}
@catch (NSException *e) {
WLLOG(@"%@: WLAPSItem UnKnown Key:%@ - Value:%@", [e name], key, idx);
}
@finally { }
}
}
......
......@@ -46,6 +46,11 @@
NSString *_message;
WLAPSItem *_apsItem;
NSDictionary *_customData;
NSString *_EXTRA_FIELDS;
NSString *_attachment_url;
NSString *_data;
NSString *_url;
}
/*!
@property action
......@@ -90,6 +95,11 @@
*/
@property (nonatomic, strong) NSDictionary *customData;
@property (nonatomic, copy) NSString *EXTRA_FIELDS;
@property (nonatomic, copy) NSString *attachment_url;
@property (nonatomic, copy) NSString *data;
@property (nonatomic, copy) NSString *url;
/*!
@methodgroup Initializing a WLBaseItem Object
*/
......
......@@ -55,13 +55,15 @@
[self setValue:idx forKey:@"action"];
else if ([key isEqualToString:@"aps"])
_apsItem = [[WLAPSItem alloc] initWithAttributes:(NSDictionary*)idx];
else if ([key isEqualToString:@"attachment-url"])
[self setValue:idx forKey:@"attachment_url"];
else
[self setValue:idx forKey:key];
}
@catch (NSException *e) {
[_customData setValue:idx forKey:key];
WLLOG(@"%@: UnKnown Key:%@ - Value:%@", [e name], key, idx); }
@finally { }
WLLOG(@"%@: WLBaseItem UnKnown Key:%@ - Value:%@", [e name], key, idx); }
@finally {}
}
}
......
......@@ -292,37 +292,38 @@ 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];
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];
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];
// 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;
......@@ -386,37 +387,38 @@ static const char* jailbreak_apps[] =
switch (state) {
case WLApplicationStateActive:
{
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];
// 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];
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;
......@@ -481,37 +483,38 @@ static const char* jailbreak_apps[] =
switch (state) {
case WLApplicationStateActive:
{
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];
// 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];
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;
......@@ -906,25 +909,25 @@ 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 * alert = [UIAlertController alertControllerWithTitle:@"WL_Warning" message:@"You have to set the mainWindow.rootViewController in order for offer views to be presented properly." preferredStyle:UIAlertControllerStyleAlert];
// 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];
UIAlertAction* yesButton = [UIAlertAction
actionWithTitle:@"OK"
style:UIAlertActionStyleDefault
handler:^(UIAlertAction * action) {
//Handle your yes please button action here
}];
// UIAlertAction* yesButton = [UIAlertAction
// actionWithTitle:@"OK"
// style:UIAlertActionStyleDefault
// handler:^(UIAlertAction * action) {
// //Handle your yes please button action here
// }];
[alert addAction:yesButton];
// [alert addAction:yesButton];
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];
// 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];
return;
}
......