SLServiceTypeFacebook setInitialText not working

I am trying to share text on Facebook using SLServiceTypeFacebook on iOS 8.3. But the popup text box appears blank. I want it to appear with text in it. Below you can see the code that I use for this.

if([SLComposeViewController isAvailableForServiceType:SLServiceTypeFacebook]) { SLComposeViewController *controller = [SLComposeViewController composeViewControllerForServiceType:SLServiceTypeFacebook]; [controller setInitialText:@"First post from my iPhone app"]; [self presentViewController:controller animated:YES completion:Nil]; } 
+44
ios social-framework
Apr 28 '15 at 17:13
source share
2 answers

The problem seems to be related to installing the latest update to the Facebook application (v29). Removing "fixes" the problem.

https://developers.facebook.com/bugs/1632385646995079/ https://developers.facebook.com/bugs/962985360399542/

Update (June 3, 2015)

Well. It appears that the new Facebook policy says pre-populating a message through setInitialText: is a violation of the preflight.

https://developers.facebook.com/docs/apps/review/prefill

So, I think the only way to share content from now on is FBSDKShareDialog

https://developers.facebook.com/docs/sharing/ios

+32
Apr 29 '15 at 14:11
source share

One must love the effectiveness of Facebook. A little late, but can help someone.

 #import <FBSDKShareKit/FBSDKShareKit.h> FBSDKShareLinkContent *content = [[FBSDKShareLinkContent alloc] init]; content.contentURL = self.urlForSocialMedia; content.contentDescription = self.textForFB; content.contentTitle = @"Results."; [FBSDKShareDialog showFromViewController:self withContent:content delegate:self]; 
+1
Aug 28 '15 at 4:32
source share



All Articles