Commit 8f0b9a68 authored by Carola Nitz's avatar Carola Nitz

VLCActivityViewControllerVendor: fix crash < iOS8 and display the completion dialog again

parent c6511ff1
......@@ -43,13 +43,14 @@
[excludedActivities addObject:UIActivityTypeMarkupAsPDF];
}
controller.excludedActivityTypes = excludedActivities;
controller.completionWithItemsHandler = ^(UIActivityType _Nullable activityType, BOOL completed, NSArray * _Nullable returnedItems, NSError * _Nullable activityError) {
controller.completionHandler = ^(UIActivityType _Nullable activityType, BOOL completed) {
APLog(@"UIActivityViewController finished with activity type: %@, completed: %i", activityType, completed);
// Provide feedback. This could cause a false positive if the user chose "Don't Allow" in the permissions dialog, and UIActivityViewController does not inform us of that, so check the authorization status.
// By the time this is called, the user has not had time to choose whether to allow access to the Photos library, so only display the message if we are truly sure we got authorization. The first time the user saves to the camera roll he won't see the confirmation because of this timing issue. This is better than showing a success message when the user had denied access. A timing workaround could be developed if needed through UIApplicationDidBecomeActiveNotification (to know when the security alert view was dismissed) or through other ALAssets APIs.
if (completed && [activityType isEqualToString:UIActivityTypeSaveToCameraRoll] && [PHPhotoLibrary authorizationStatus] == PHAuthorizationStatusAuthorized) {
if (completed && [activityType isEqualToString:UIActivityTypeSaveToCameraRoll]) {
[viewController vlc_showAlertWithTitle:NSLocalizedString(@"SHARING_SUCCESS_CAMERA_ROLL", nil)
message:nil
buttonTitle:NSLocalizedString(@"BUTTON_OK", nil)];
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment