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
How to Know If Nsassert Is Disabled in Release Builds
New Foursquare Venue Detail Map
How to Determine Device Type from Swift? (Os X or iOS)
How to Capture Picture with Avcapturesession in Swift
Move a View When Scrolling in Uitableview
Expanding and Collapsing Table View Cells in iOS
Show Search Bar in Navigation Bar Without Scrolling on iOS 11
--Resource-Rules Has Been Deprecated in MAC Os X >= 10.10
How to Use Cocoapods When Creating a Cocoa Touch Framework
How to Keep an Iphone/iPad Web App in Full Screen Mode
Can't Set Headers on My Wkwebview Post Request
Connect to Vpn Programmatically in iOS 8
How to Stop Firebase from Logging Status Updates When App Is Launched
Swift:Missing Argument Label 'Xxx' in Call
Uisearchbar Change Placeholder Color
Programmatic Uiscrollview with Autolayout