Facebook sdk open user.linkURL in UIWebview

198 views Asked by At

I want to show a user's friend's profile page in my app. I think I can use the linkURL property to do this? However, it fails. I've tried opening a test user's friend's linkURL in UIWebview, but it fails. Is this link used for this purpose?

func loadUserProfile(user:User, completion:CompletionBlockStd){

    loadUrl(user.link)
    completion()
}

func loadUrl(url:String) {
        weak var wv = self.webView

        dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_HIGH, 0), { () -> Void in
            var request = NSMutableURLRequest(URL: NSURL(string: url)!)
            var headers = NSHTTPCookie.requestHeaderFieldsWithCookies(NSHTTPCookieStorage.sharedHTTPCookieStorage().cookies!)
            request.allHTTPHeaderFields = headers
            //request.setValue("iPhone", forHTTPHeaderField: "User-Agent")
            wv!.loadRequest(request)
        })
        self.enableTimeoutTimer(true)
    }

//user.link (test user) = https://www.facebook.com/app_scoped_user_id/1424064921250774/
0

There are 0 answers