我需要通过我的应用程序来浏览Facebook的特定页面。
以下是我的代码
@IBAction func btnLikeUsClicked(sender: AnyObject) {
let urlStr = "MY_PAGE_URL"
var modifiedURLString = String (format: "https://graph.facebook.com/me/og.likes?object=%@&access_token=%@", urlStr,FBSession.activeSession().accessTokenData.accessToken)
println("Modified String : \(modifiedURLString)")
var facebookUrl = NSURL(string: modifiedURLString)
var req = NSMutableURLRequest (URL: facebookUrl!)
req.HTTPMethod = "POST"
var response : AutoreleasingUnsafeMutablePointer <NSURLResponse?> = nil
var err : NSErrorPointer = nil
var resData : NSData = NSURLConnection.sendSynchronousRequest(req, returningResponse: response, error: err)!
var Content = NSString(data: resData, encoding: NSUTF8StringEncoding)
}
但我没有任何影响。
请进一步帮助我
答案 0 :(得分:0)
你不能og.like页面。如果您需要,请使用iOS的“赞”按钮:https://developers.facebook.com/docs/ios/like-button