Sharing using SLComposeViewController
Hi Friends !!! Here I am Trying My Best for how To share Image, URL andString In Facebook and Twitter with the help of SLComposeViewController. So,I think its may be very helpful to you,Because here I am Trying so simple & easy language and method so that everyone can understand it very quickly.
1 . ShareFile.h and ShareFile.m both files are given below. so download it from given below link and drag and drop in your project (keep both the copy of that file) .
2) Sharefile.m Click Here :-
2. Add below two framework in your project. (Click on Targets ->your app name -> and then the "Build Phase " tab. "Expand 'LinkBinary with Libraries" click the + button in the bottom left of the "Link Binary with Libraries" selection")
-Accounts.framework
-Social.framework
3. After adding above two framework now import ShareFile.h file. in your view controller where you want to use.
If you want to Share your feeds In your Facebook through on your button click event Then refer the below code .
//When sharing Only String on Facebook [[ShareFile sharedSinglton] Fbsharing:@"Rathod's Demo"];
If Sharing String and URL on FaceBook
// When sharing String, URL on Facebook[[ShareFile sharedSinglton] Fbsharing:@"Rathod's Demo" :[NSURLURLWithString:@"http://aniruddhsinhiostutorial.blogspot.in/"]];
If Sharing String , URL and Image on FaceBook
// When sharing String, URL and Image on Facebook[[ShareFile sharedSinglton] Fbsharing:@"Rathod's Demo" :[NSURLURLWithString:@"http://aniruddhsinhiostutorial.blogspot.in/"] :[UIImage imageNamed:@"AniruddhSinh.png"]];
If you want to Share your feeds In your Twitter through on your button click event Then refer the below code .
//When sharing Only String on Twitter[[ShareFile sharedSinglton] twittersharing:@"Rathod's Demo"];
If Sharing String and URL on Twitter
//When sharing String, URL on Twitter[[ShareFile sharedSinglton]twittersharing:@"Rathod's Demo":[NSURLURLWithString:@"http://aniruddhsinhiostutorial.blogspot.in/"] :[UIImage imageNamed:@"AniruddhSinh.png"]];
If Sharing String , URL and Image on Twitter
// When sharing String, URL and Image on Twitter[[ShareFile sharedSinglton] twittersharing:@"Rathod's Demo" :[NSURLURLWithString:@"http://aniruddhsinhiostutorial.blogspot.in/"] :[UIImage imageNamed:@"AniruddhSinh.png"]];
here you can share your feeds in your Facebook and Twitter with the help of above code . so enjoy every movement of programing. Thank you.
Note :- You Must Configure you Facebook and Twitter Account in your Device.
|
No comments:
Post a Comment