Is there any way to receive UIApplicationUserDidTakeScreenshotNotification within an iMessage App?

Is there any way to receive UIApplicationUserDidTakeScreenshotNotification within an iMessage App? This never fires:


[[NSNotificationCenter defaultCenter] addObserverForName:UIApplicationUserDidTakeScreenshotNotification object:nil queue:[NSOperationQueue mainQueue] usingBlock:^(NSNotification * _Nonnull note)

{

NSLog(@"Got here!");

}];

Replies

Not currently. The reason that your block is never called is because your code is operating in the context of an extension, whereas that notification is posted in the parent application (Messages, in this case). This would make for a good enhancement request, which you should file at bugreport.apple.com (we track enhancement requests in the same database as bug reports).

Done. Filed as #35336076

Hi,

Was there a solution for this?

I have been looking for an answer to this question for three days and this is the only other place I have found the question being asked! Did you ever figure out any solution that worked?