-1

When i share an iTunes url on Facebook using SLComposerViewController, the post on Facebook is not showing the link description. Where as if i try some other URL's then i the post is showing the link description.

  • What is the url,you are posting? Are you using www or http? – Ritu May 14 '15 at 04:56
  • use the URL as http : //www .yourDomain.com the description defined at the url will be displayed automatically – Fatti Khan May 14 '15 at 04:57
  • remove the spaces from the above url and it works – Fatti Khan May 14 '15 at 04:58
  • i am using iTunes URL which is "https" – Pranay Reddy May 14 '15 at 04:58
  • i am able to share the url successfully and when user click on the Facebook post user is getting redirected to iTunes link. My question is for some of the Url's a description is show in the Facebook post (which it is fetching from the url we give) but it is not doing for iTunes URL. (as i don't have enough credits was not able to post image ) – Pranay Reddy May 14 '15 at 05:02
  • Check this link : http://www.bloggersentral.com/2010/11/facebook-share-shows-wrong-description.html – Ritu May 14 '15 at 05:08
  • Answers my question, Thanks - Ritu – Pranay Reddy May 14 '15 at 05:18

1 Answers1

0
if ([SLComposeViewController isAvailableForServiceType:SLServiceTypeFacebook]) {

    SLComposeViewController *mySLComposerSheet = [SLComposeViewController composeViewControllerForServiceType:SLServiceTypeFacebook];

    [mySLComposerSheet addImage:[UIImage imageNamed:@"s_720.jpg"]];
    [mySLComposerSheet setInitialText:@"check my swap card..."];
    [mySLComposerSheet addURL:[NSURL URLWithString:[swap_card_dict valueForKey:@"swapcard_url"]]];
    [mySLComposerSheet setCompletionHandler:^(SLComposeViewControllerResult result) {
      switch (result) {
               case SLComposeViewControllerResultCancelled:
               NSLog(@"Post Canceled");
               break;
               case SLComposeViewControllerResultDone:
                {
                 NSLog(@"Post Sucessful");
                }
                break;

               default:
                 break;
                }
            }];

[[self viewController] presentViewController:mySLComposerSheet animated:YES completion:nil];

}