Both the extension and the receiving application are in the same app group.
I can't find the issue. It doesn't seem to be a problem with entitlements. Maybe an issue with the string formatting/conversion? Maybe I am not allowed to send distributed center notifications from the camera extension?
I am sending the notification calling:
func notifyChangeInUsage() {
os_log("Notifying the virtual camera change in usage", log: cdsLog, type: .info) // this is logged
DistributedNotificationCenter.default().postNotificationName(NSNotification.Name("VirtualCamUsageChanged"), object: nil, userInfo: nil, deliverImmediately: true)
}
And receiving it in the other end, subscribing with
std::string notification = "VirtualCamUsageChanged"
[mObserverClassInstance subscribe:@(notification.c_str())];
where subscribe is the following method, which is tested to be working.
- (void)subscribe:(NSString *)notification {
[[NSDistributedNotificationCenter defaultCenter]
addObserver:self
selector:@selector(callCallback:)
name:notification
object:nil
suspensionBehavior:NSNotificationSuspensionBehaviorDeliverImmediately];
}