I am trying to use UIActivityViewController as open-in option in my app.
I am using below code:
- (void)displayThroughOpenIn
{
NSString *localFilePathString = [self
generateLocalPathForFile:self.mCurrentFile];
NSURL *localFilePath = [NSURL fileURLWithPath:localFilePathString];
NSArray *activityItems = @[localFilePath];
//-- initialising the activity view controller
UIActivityViewController *avc = [[UIActivityViewController alloc]
initWithActivityItems:activityItems
applicationActivities:nil];
//-- define the activity view completion handler
avc.completionHandler = ^(NSString *activityType, BOOL completed)
{
if (completed) {
}
else
{
// cancel button clicked
// poup the view controller from navigation view stack
[self popToBackViewController];
}
};
//-- define activity to be excluded (if any)
avc.excludedActivityTypes = [NSArray
arrayWithObjects:UIActivityTypeAssignToContact, nil];
//-- show the activity view controller
[self presentViewController:avc
animated:YES completion:nil];
}
Problem is - It is not displaying any of the third party apps, such as
adobe reader, chrome.
I think this is because I am passing applicationActivities as nil in –
initWithActivityItems:applicationActivities: .
If this is the case then do I need to subclass UIActivity for each of the
third party apps and it will not support those apps by default?
Please clarify.
_______________________________________________
Cocoa-dev mailing list ([email protected])
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com
This email sent to [email protected]