|
@@ -464,6 +464,7 @@
|
|
{
|
|
{
|
|
NSLog(@"Push notification: %@", userInfo);
|
|
NSLog(@"Push notification: %@", userInfo);
|
|
|
|
|
|
|
|
+ NSUInteger fetchResult = UIBackgroundFetchResultNoData;
|
|
NSString *message = [userInfo objectForKey:@"subject"];
|
|
NSString *message = [userInfo objectForKey:@"subject"];
|
|
|
|
|
|
if (message) {
|
|
if (message) {
|
|
@@ -479,18 +480,25 @@
|
|
|
|
|
|
NSString *app = [json objectForKey:@"app"];
|
|
NSString *app = [json objectForKey:@"app"];
|
|
NSString *subject = [json objectForKey:@"subject"];
|
|
NSString *subject = [json objectForKey:@"subject"];
|
|
|
|
+ NSInteger notificationId = [[json objectForKey:@"nid"] integerValue];
|
|
|
|
|
|
if ([app isEqualToString:@"spreed"]) {
|
|
if ([app isEqualToString:@"spreed"]) {
|
|
content.title = @"Nextcloud Talk";
|
|
content.title = @"Nextcloud Talk";
|
|
} else {
|
|
} else {
|
|
content.title = app.capitalizedString;
|
|
content.title = app.capitalizedString;
|
|
}
|
|
}
|
|
|
|
+ content.title = [NSString stringWithFormat:@"%@ (%@)", content.title, result.account];
|
|
|
|
+
|
|
if (subject) {
|
|
if (subject) {
|
|
content.body = subject;
|
|
content.body = subject;
|
|
} else {
|
|
} else {
|
|
content.body = @"Nextcloud notification";
|
|
content.body = @"Nextcloud notification";
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ [[OCNetworking sharedManager] getServerNotification:result.url notificationId:notificationId completion:^(NSString *message, NSInteger errorCode) {
|
|
|
|
+ //
|
|
|
|
+ }];
|
|
|
|
+
|
|
content.sound = [UNNotificationSound defaultSound];
|
|
content.sound = [UNNotificationSound defaultSound];
|
|
|
|
|
|
NSString *identifier = [NSString stringWithFormat:@"Notification-%@", [NSDate new]];
|
|
NSString *identifier = [NSString stringWithFormat:@"Notification-%@", [NSDate new]];
|
|
@@ -500,11 +508,14 @@
|
|
|
|
|
|
[[UNUserNotificationCenter currentNotificationCenter] addNotificationRequest:request withCompletionHandler:nil];
|
|
[[UNUserNotificationCenter currentNotificationCenter] addNotificationRequest:request withCompletionHandler:nil];
|
|
|
|
|
|
|
|
+ fetchResult = UIBackgroundFetchResultNewData;
|
|
break;
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ completionHandler(fetchResult);
|
|
}
|
|
}
|
|
|
|
|
|
#pragma FIREBASE
|
|
#pragma FIREBASE
|