Simple way to post on Facebook wall

S

The UIActivityViewController class is a standard view controller that you can use to offer various services from your application. The system provides several standard services, such as copying items to the pasteboard, posting content to social media sites, sending items via email or SMS, and more. Apps can also define custom services.

If you want to share some message or image with social networking site like Facebook, twitter then this code always help for you.

NSString *LinkPath = @”https://itunes.apple.com/us/app/apps-catalog-best-apps-lists/id645785418?ls=1&mt=8″;

NSString * postText = [NSString stringWithFormat:@” Here is your message !!!!! : %@” , LinkPath];

UIImage *anImage = [UIImage imageNamed:@”icon@2x.png”];
NSArray *Items = [NSArray arrayWithObjects:
[NSString stringWithFormat:@”%@”, postText],
anImage, nil];

UIActivityViewController *ActivityView = [[UIActivityViewController alloc] initWithActivityItems:Items applicationActivities:nil];
[self presentViewController:ActivityView animated:YES completion:nil];

About the author

mayur.bhansali
By mayur.bhansali

Category