0
私のアプリには「facebook」のボタンがあります。しかし、私はそれが欲しいのように動作しません。Facebookで共有すると、テキストは電話に表示されません。 (スウィフト)
私は別のコードを試しましたが、私の電話では働いていませんでした。 ウィンドウがポップアップし、私が望むなら何かを共有することができます。しかし、initialTextは私のiPhoneには表示されませんが、それはシミュレータに表示されますか? シミュレータでのみ、私はfacebookが当然働かないという警告を受け取ります。
これを解決する方法は誰にでも分かります。それとも可能ですか?
これは私が使用するコードです:
if SLComposeViewController.isAvailableForServiceType(SLServiceTypeFacebook){
let facebookSheet:SLComposeViewController = SLComposeViewController(forServiceType: SLServiceTypeFacebook)
facebookSheet.setInitialText("\(antwoordTxt.text!)")
self.presentViewController(facebookSheet, animated: true, completion: nil)
} else {
let alert = UIAlertController(title: "Accounts", message: "Please login to a Facebook account to share.", preferredStyle: UIAlertControllerStyle.Alert)
alert.addAction(UIAlertAction(title: "OK", style: UIAlertActionStyle.Default, handler: nil))
self.presentViewController(alert, animated: true, completion: nil)
}