Skip to content

Commit

Permalink
Added Linkedin Example
Browse files Browse the repository at this point in the history
  • Loading branch information
dongri committed Dec 30, 2014
1 parent b9647f5 commit 1eba285
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions OAuthSwiftDemo/ViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,15 @@ class ViewController: UIViewController, UITableViewDelegate, UITableViewDataSour
oauthswift.authorizeWithCallbackURL( NSURL(string: "oauth-swift://oauth-callback/linkedin")!, success: {
credential, response in
self.showAlertView("Linkedin", message: "oauth_token:\(credential.oauth_token)\n\noauth_toke_secret:\(credential.oauth_token_secret)")
var parameters = Dictionary<String, AnyObject>()
oauthswift.client.get("https://api.linkedin.com/v1/people/~", parameters: parameters,
success: {
data, response in
let dataString = NSString(data: data, encoding: NSUTF8StringEncoding)
println(dataString)
}, failure: {(error:NSError!) -> Void in
println(error)
})
}, failure: {(error:NSError!) -> Void in
println(error.localizedDescription)
})
Expand Down

0 comments on commit 1eba285

Please sign in to comment.