No permission to save image but UIActivityViewController completion return no error

Viewed 374

I have this code

UIActivityViewController *activityViewController = [[UIActivityViewController alloc] initWithActivityItems:@[self.imageView.image] applicationActivities:nil];

__weak typeof(self) weakSelf = self;
UIActivityViewControllerCompletionWithItemsHandler completionHandlerBlock = ^void(NSString * __nullable activityType, BOOL completed, NSArray * __nullable returnedItems, NSError * __nullable activityError) {

    if (activityType == UIActivityTypeSaveToCameraRoll && completed) {
        [EkoAlertService presentAlertOnViewController:weakSelf
                                            withTitle:NSLocalizedString(@"save_photo_dialog_title", nil)
                                              message:NSLocalizedString(@"save_photo_dialog_message", nil)
                                           completion:nil];
    }
};

[activityViewController setCompletionWithItemsHandler:completionHandlerBlock];

[self presentViewController:activityViewController animated:YES completion:nil];

enter image description here

It works fine in the case when user click allow permission to Save Image, but when they click don't allow permission I expect it to return some error but activityError is nil and I have no way to check whether you successfully save image to camera roll. Both cases return completed = YES

Is there a way to check this?

Thanks

0 Answers
Related