6
私は、Gmailアカウントからメールを読むためにoAuth2.0を使用しています。そして、ここに私のコードコードをコピーして、アプリケーションに切り替えて貼り付けてください。
oauthswift = OAuth2Swift(
consumerKey: "242468529977-xxxxxxxxxxxxxxxxxxxx.apps.googleusercontent.com",
consumerSecret: "GfGVl_xxxxxxxxxxmjnAX",
authorizeUrl: "https://accounts.google.com/o/oauth2/auth",
accessTokenUrl: "https://accounts.google.com/o/oauth2/token",
responseType: "code"
)
oauthswift?.allowMissingStateCheck = true
let _ = oauthswift?.authorize(
withCallbackURL: URL(string: "urn:ietf:wg:oauth:2.0:oob")!, scope: "https://www.googleapis.com/auth/gmail.metadata", state: "",
success: { credential, response, parameters in
let parameters = Dictionary<String, AnyObject>()
// Multi-part upload
print(credential)
print(response)
},
failure: { error in
print("ERROR: \(error.localizedDescription)")
}
)
ですが、私は許可を許可した後、それが私にこの画面
を示すとを言うている「このコードをコピーし、アプリケーションに切り替えて貼り付けてください。」しかし、コードを貼り付ける場所はわかりません。
Jecky consumerSecretハンドラメソッドを使用している必要があります:「」、あなたのキー値を削除し、そう私にとってはそれにその仕事をしてみてください –