[GH-ISSUE #137] Sample code in the readme is incorrect for oauth2 #82

Closed
opened 2026-03-03 16:45:32 +03:00 by kerem · 1 comment
Owner

Originally created by @dougw on GitHub (Nov 5, 2015).
Original GitHub issue: https://github.com/OAuthSwift/OAuthSwift/issues/137

It looks like the signature for the success callback has changed -- and should include 'parameters'.

The current code does not compile.

The fix is below

oauthswift.authorizeWithCallbackURL( NSURL(string: "oauth-swift://oauth-callback/instagram"), scope: "likes+comments", state:"INSTAGRAM", success: {
    credential, response, **parameters** in
    println(credential.oauth_token)
}, failure: failureHandler)
Originally created by @dougw on GitHub (Nov 5, 2015). Original GitHub issue: https://github.com/OAuthSwift/OAuthSwift/issues/137 It looks like the signature for the success callback has changed -- and should include 'parameters'. The current code does not compile. The fix is below ``` oauthswift.authorizeWithCallbackURL( NSURL(string: "oauth-swift://oauth-callback/instagram"), scope: "likes+comments", state:"INSTAGRAM", success: { credential, response, **parameters** in println(credential.oauth_token) }, failure: failureHandler) ```
kerem 2026-03-03 16:45:32 +03:00
  • closed this issue
  • added the
    bug
    label
Author
Owner

@phimage commented on GitHub (Nov 5, 2015):

Yes you are right
You can fork, edit readme( with in commit comment Fix #137) and make a Pull request
And maybe one day it will be merged

<!-- gh-comment-id:154005714 --> @phimage commented on GitHub (Nov 5, 2015): Yes you are right You can fork, edit readme( with in commit comment Fix #137) and make a Pull request And maybe one day it will be merged
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/OAuthSwift#82
No description provided.