Commit 94a80117 by Sebastián Katzer

Change code formatting

parent 71e71809
...@@ -98,33 +98,33 @@ ...@@ -98,33 +98,33 @@
/** /**
* @private * @private
* Erstellt die Notification und setzt deren Eigenschaften.
*/ */
- (UILocalNotification*) prepareNotification:(NSMutableDictionary*)options - (UILocalNotification*) prepareNotification:(NSMutableDictionary*)options
{ {
double timestamp = [[options objectForKey:@"date"] doubleValue]; UILocalNotification* notification = [[UILocalNotification alloc] init];
NSString* msg = [options objectForKey:@"message"];
NSString* title = [options objectForKey:@"title"]; double timestamp = [[options objectForKey:@"date"] doubleValue];
NSString* sound = [options objectForKey:@"sound"]; NSString* msg = [options objectForKey:@"message"];
NSString* repeat = [options objectForKey:@"repeat"]; NSString* title = [options objectForKey:@"title"];
bool hasAction = ([[options objectForKey:@"hasAction"] intValue] == 1)?YES:NO; NSString* sound = [options objectForKey:@"sound"];
NSInteger badge = [[options objectForKey:@"badge"] intValue]; NSString* repeat = [options objectForKey:@"repeat"];
NSDate* date = [NSDate dateWithTimeIntervalSince1970:timestamp]; bool hasAction = ([[options objectForKey:@"hasAction"] intValue] == 1)?YES:NO;
NSInteger badge = [[options objectForKey:@"badge"] intValue];
UILocalNotification* notification = [[UILocalNotification alloc] init]; NSDate* date = [NSDate dateWithTimeIntervalSince1970:timestamp];
notification.fireDate = date; notification.fireDate = date;
notification.timeZone = [NSTimeZone defaultTimeZone]; notification.timeZone = [NSTimeZone defaultTimeZone];
notification.repeatInterval = [[[self repeatDict] objectForKey: repeat] intValue]; notification.repeatInterval = [[[self repeatDict] objectForKey: repeat] intValue];
if ([msg isEqualToString:@""]) { if (![msg isEqualToString:@""])
//No message, we just want to update the badge {
notification.alertBody = nil; notification.alertBody = title ? [NSString stringWithFormat:@"%@\n%@", title, msg] : msg;
} else {
notification.alertBody = title ? [NSString stringWithFormat:@"%@\n%@", title, msg] : msg;
} }
if (sound != (NSString *) [NSNull null]) { if (sound != (NSString *) [NSNull null])
notification.soundName = [sound isEqualToString:@""] ? UILocalNotificationDefaultSoundName : sound; {
notification.soundName = [sound isEqualToString:@""] ? UILocalNotificationDefaultSoundName : sound;
} }
notification.hasAction = hasAction; notification.hasAction = hasAction;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment