微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

OAuthSwift OAuth 页面示例Setting Swift CompilerSetting URL SchemesImages

程序名称:OAuthSwift OAuth 页面示例Setting Swift CompilerSetting URL SchemesImages

授权协议: 未知

操作系统: iOS

开发语言: Swift

OAuthSwift OAuth 页面示例Setting Swift CompilerSetting URL SchemesImages 介绍

OAuthSwift 是基于 Swift 的 OAuth 的 iOS 库,支持 OAuth 1 和 OAuth 2。

OAuth 页面

Twitter
Flickr
Github
Instagram
Foursquare
Fitbit
Withings

示例

// OAuth1.0
let oauthswift = OAuth1Swift(
    consumerKey:    "********",
    consumerSecret: "********",
    requestTokenUrl: "https://api.twitter.com/oauth/request_token",
    authorizeUrl:    "https://api.twitter.com/oauth/authorize",
    accesstokenUrl:  "https://api.twitter.com/oauth/access_token"
)
oauthswift.authorizeWithCallbackURL( NSURL(string: "oauth-swift://oauth-callback/twitter"), success: {
    credential, response in
    println(credential.oauth_token)
    println(credential.oauth_token_secret)
}, failure: failureHandler)

// OAuth2.0
let oauthswift = OAuth2Swift(
    consumerKey:    "********",
    consumerSecret: "********",
    authorizeUrl:   "https://api.instagram.com/oauth/authorize",
    responseType:   "token"
)
oauthswift.authorizeWithCallbackURL( NSURL(string: "oauth-swift://oauth-callback/instagram"), scope: "likes+comments", state:"INSTAGRAM", success: {
    credential, response in
    println(credential.oauth_token)
}, failure: failureHandler)

Setting Swift Compiler

Setting URL Schemes

Images

OAuthSwift OAuth 页面示例Setting Swift CompilerSetting URL SchemesImages 官网

https://github.com/dongri/OAuthSwift

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐