ios - UIActivityViewController completion handler is !completed when using AirDrop -
i using uiactivityviewcontroller
share text , url works great when sending text , url.
i need utilize completion handler perform additional actions depending whether user cancelled uiactivityviewcontroller
or sent something.
the completion handler (activityviewcontroller.completionhandler
ios 7 deprecated in ios 8 activityviewcontroller setcompletionwithitemshandler
) returns bool completed
value correctly returns true
when sending email
sms
facebook
twitter
when sending via airdrop
user must press cancel
dismiss uiactivityviewcontroller
1 time sent , receive false
completion handler.
does know if there's way of knowing user has sent using airdrop
when uiactivityviewcontroller
dismissed?
thanks
i've found of involvement unfortunately couldn't test airdrop didn't want function between idevices. sorry that.
anyway, seek setcompletionwithitemshandler
checking activitytype
:
[activityviewcontroller setcompletionwithitemshandler:^(nsstring *activitytype, bool completed, nsarray *returneditems, nserror *activityerror) { nslog(@"completed: %@, \n%d, \n%@, \n%@,", activitytype, completed, returneditems, activityerror); }];
if activitytype
of type com.apple.airdrop.etc
(just guess) user has tapped on icon. hope can help.
ios uiactivityviewcontroller uiactivity uiactivitytypeairdrop
No comments:
Post a Comment