UIActivityViewController completion handler is !completed when using AirDrop

后端 未结 1 497
Happy的楠姐
Happy的楠姐 2021-01-13 15:57

I am using UIActivityViewController to share some text and url which works great when sending some text and a url.

I currently need to use the completio

相关标签:
1条回答
  • 2021-01-13 16:05

    I've found something of interest for you but unfortunately I couldn't test it as AirDrop didn't want to function between my iDevices. Sorry about that.

    Anyway, you could try setCompletionWithItemsHandler checking for activityType:

    [activityViewController setCompletionWithItemsHandler:^(NSString *activityType, BOOL completed, NSArray *returnedItems, NSError *activityError) {
        NSLog(@"completed: %@, \n%d, \n%@, \n%@,", activityType, completed, returnedItems, activityError);
    
    }];
    

    If activityType is of type com.apple.airdrop.etc (just a guess) then the user has tapped on the icon. Hope it can help.

    0 讨论(0)
提交回复
热议问题