Sunday, 16 June 2013
How to post Facebook Status from iOS App..?
Posted by
Unknown
| Sunday, 16 June 2013
1. Add SocialFramework from libraries
2. Import header file to ViewController.h
3. Create one button using Interface Builder, make connection to ViewContoller.m
4. Paste below code in ViewController.h in ViewDidLoad method
- (IBAction)postFacebook:(UIButton *)sender {
if ([SLComposeViewController isAvailableForServiceType:SLServiceTypeTwitter]) {
SLComposeViewController *controller=[SLComposeViewController composeViewControllerForServiceType:SLServiceTypeTwitter];
[controller setInitialText:@""];
[self presentViewController:controller animated:YES completion:nil];
}
2. Import
3. Create one button using Interface Builder, make connection to ViewContoller.m
4. Paste below code in ViewController.h in ViewDidLoad method
- (IBAction)postFacebook:(UIButton *)sender {
if ([SLComposeViewController isAvailableForServiceType:SLServiceTypeTwitter]) {
SLComposeViewController *controller=[SLComposeViewController composeViewControllerForServiceType:SLServiceTypeTwitter];
[controller setInitialText:@""];
[self presentViewController:controller animated:YES completion:nil];
}
Related Posts : Facebook,
Status