Post

Replies

Boosts

Views

Activity

Reply to Distributed notification no longer working
Kinda janky but you can still send notifications if the CFDictionaryRef is nil CFNotificationCenterPostNotification(CFNotificationCenterRef center, CFNotificationName name, const void *object, CFDictionaryRef userInfo, Boolean deliverImmediately) So you can convert the userInfo dict into a string NSError * err; NSData * jsonData = [NSJSONSerialization dataWithJSONObject:dict options:0 error:&err]; NSString * myString = [[NSString alloc] initWithData:jsonData  encoding:NSUTF8StringEncoding]; CFNotificationCenterRef center = CFNotificationCenterGetDistributedCenter(); CFNotificationCenterPostNotification(center, CFSTR("myNotification"), (__bridge const void *)(myString), nil, true); Then in the receiving app convert the string back to a dict void notificationCallback (CFNotificationCenterRef center, void * observer, CFStringRef name, const void * object, CFDictionaryRef userInfo) { 	NSString * strObject = (__bridge NSString *)object;   NSData * data = [strObject dataUsingEncoding:NSUTF8StringEncoding]; 	NSDictionary * response; 	if (data != nil) {     response = (NSDictionary *)[NSJSONSerialization JSONObjectWithData:data options:NSJSONReadingMutableContainers error:&err]; 	} } Not sure of the Swift implementation but it should work.
Oct ’20