Slservicetypefacebook Setinitialtext Is Not Working

SLServiceTypeFacebook setInitialText is not working

It seems to be a problem having installed the latest Facebook app update (v29). Removing it "fixes" the problem.

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

Update (Jun. 3, 2015)

Well. It seems that the new Facebook policy says that prefilling a message through setInitialText: is a prefill violation.

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

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

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

SLServiceTypeFacebook setinitialtext not working

This certainly is a strange issue, and see as I don't see anything else obviously wrong with this, so here's my suggestion. It is possible that somehow something's getting messed up due to the extraneous initializer you have set on the composer. composeViewControllerForServiceType: already alloc/init's an instance of SLComposeViewController, so there is no need to add init. Replace this:

SLComposeViewController *faceSheet = [[SLComposeViewController composeViewControllerForServiceType:SLServiceTypeFacebook] init];

With this line:

SLComposeViewController *faceSheet = [SLComposeViewController composeViewControllerForServiceType:SLServiceTypeFacebook];

SLComposeViewController won't set initialText for SLServiceTypeFacebook

Not a bug, Facebook doesn't allow it anymore.

Use of the iOS share sheet is subject to Facebook Platform Policy, including section 2.3 which states that apps may not pre-fill. In the context of the share sheet, this means apps may not pre-fill the share sheet's initialText field with content that wasn't entered by people earlier in their use of the app.

Swift - SLComposeViewController automatically dismissing itself

This is working and for SLServiceTypeFacebook too but need to dismiss one to present the other. I am still working that out.

if let vc = SLComposeViewController(forServiceType: SLServiceTypeTwitter) {

//SLServiceTypeFacebook
//SLServiceTypeTwitter

vc.setInitialText(self.writeDBString)
//vc.add(UIImage(named: "myImage.jpg")!)
vc.add(URL(string: "https://itunes.apple.com/us/app"))
present(vc, animated: true )
}


Related Topics



Leave a reply



Submit