UIActivityViewController completion handler is !completed when using AirDrop

梦想的初衷 提交于 2019-12-01 06:29:33

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.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!