Monday 16 December 2013

Sharing Your message in Social Websites like Facebook, Twitter, GooglePlus, LinkedIn


Sharing your text in Facebook....


1. Import the SocialFramework in your project and #import<Social/Social.h> in your ViewController.
2. In the button action write the below code.

   SLComposeViewController *send = [SLComposeViewController  composeViewControllerForServiceType:SLServiceTypeFacebook];
  [send setInitialText:@"Say some thing "];
  [self presentViewController:send animated:YES completion:nil];

Sharing your text in Twitter....


1. Import the SocialFramework in your project and #import<Social/Social.h> in your ViewController.
2. In the button action write the below code.

   SLComposeViewController *send = [SLComposeViewController  composeViewControllerForServiceType:SLServiceTypeTwitter];
  [send setInitialText:@"Say some thing "];
  [self presentViewController:send animated:YES completion:nil];


Sharing your text in GooglePlus....

1. In the button action write the below code.

NSString *post =[NSString stringWithFormat:@"http://plus.google.com/share?url=yoururl"];
NSLog(@"s is %@",post);
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:post]];


Sharing your text in LinkedIn....


1. Add this folder to your project .
2. If you are using Arc in your project then go to project settings and go to BuildPhases and add "-fno-objc-arc" to the particular class.
3.For example  See this link
4. Go to LinkedIn Developer website and create your own API key and Secret .
5. Provide your API key and secret  in MISLinkedinShare.h.
6. In your view controller #import "MISLinkedinShare.h"
7. In your button action write the below code.

[[MISLinkedinShare sharedInstance] shareContent:self postTitle:@"your title" postDescription:@"your Description" postURL:@"your url" postImageURL:@"your image url"];








No comments:

Post a Comment