Fix to identifier string on MacOS.

This commit is contained in:
Greg 2020-06-26 22:09:02 -04:00
parent 8adb6873d1
commit 4369b7f8c6
1 changed files with 2 additions and 1 deletions

View File

@ -46,9 +46,10 @@ notify(char *id, char *title, char *content) {
UNMutableNotificationContent *note = [[UNMutableNotificationContent alloc] init]; UNMutableNotificationContent *note = [[UNMutableNotificationContent alloc] init];
note.title = [[NSString alloc] initWithUTF8String: title]; note.title = [[NSString alloc] initWithUTF8String: title];
note.body = [[NSString alloc] initWithUTF8String: content]; note.body = [[NSString alloc] initWithUTF8String: content];
NSString *identifier = [[NSString alloc] initWithUTF8String: id];
NSLog(@"Creating request"); NSLog(@"Creating request");
UNNotificationRequest *req = [UNNotificationRequest requestWithIdentifier:@"Gio" content: note trigger:nil]; UNNotificationRequest *req = [UNNotificationRequest requestWithIdentifier:identifier content: note trigger:nil];
ret = req.identifier; // FIXME: need to call retain? ret = req.identifier; // FIXME: need to call retain?
NSLog(@"Adding notification request"); NSLog(@"Adding notification request");
[nc addNotificationRequest:req withCompletionHandler: ^(NSError *error) { [nc addNotificationRequest:req withCompletionHandler: ^(NSError *error) {