Following code only share text with default iOS application
-(void)shareActionToOtherApp{
NSMutableArray *shareItems = [[NSMutableArray alloc]initWithObjects:@"Hii, You can install this app by clicking this link.", @"http://google.com/", nil];
UIActivityViewController *shareController = [[UIActivityViewController alloc]
initWithActivityItems: shareItems applicationActivities :nil];
[shareController setValue:@"Your App" forKey:@"subject"];
shareController.excludedActivityTypes = @[UIActivityTypePostToWeibo, UIActivityTypeAssignToContact, UIActivityTypePrint, UIActivityTypeCopyToPasteboard, UIActivityTypeSaveToCameraRoll];
shareController.completionHandler = ^(NSString *activityType, BOOL completed)
{
NSLog(@" activityType: %@", activityType);
NSLog(@" completed: %i", completed);
};
[self presentViewController: shareController animated: YES completion: nil];
}
No comments:
Post a Comment