2016-07-01 10 views
1

iOSアプリからfacebookでリンクを共有できません。 私は以下のコードを使用していましたが、数ヶ月前に動作していました。私が行うために使用 唯一のセットアップは「輸入は社会facebookで共有する

@IBAction func facebookShareButtonTouched(sender: AnyObject) { 
    if SLComposeViewController.isAvailableForServiceType(SLServiceTypeFacebook) { 
     let fbShare:SLComposeViewController = SLComposeViewController(forServiceType: SLServiceTypeFacebook) 

     fbShare.addURL(NSURL(fileURLWithPath: "https://www.xxx.ro/info/article/\(newsObject.id!)")) 
     self.presentViewController(fbShare, 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) 
    } 
} 

今ではFacebookの共有]ダイアログボックスを開きますが、それは任意のリンクが含まれていませんでした。 誰でも変更内容を知っていますか?

+0

あなたはそれをスクリーンショットすることはできますか? – Proton

答えて

1

この

fbShare.addURL(NSURL("https://www.xxx.ro/info/article/\(newsObject.id!)")) 

fbShare.addURL(NSURL(fileURLWithPath: "https://www.xxx.ro/info/article/\(newsObject.id!)")) 

この行を置き換えますが、あなたが共有URLを望ん考慮回答 - "https://www.xxx.ro/info/article/xid"

関連する問題