任意のチャンスを?私はアプリで実装していたいくつかの自動化された電子メールのためにMailGunにPOSTしようとしても同様の問題がありました。
大規模なHTTP応答で正常に動作するようになりました。 Keys.plistに完全なパスを入れて、自分のコードをgithubにアップロードして、引数のいくつかを変数に分解して、後にプログラムでそれらを設定することができます。
// Email the FBO with desired information
// Parse our Keys.plist so we can use our path
var keys: NSDictionary?
if let path = NSBundle.mainBundle().pathForResource("Keys", ofType: "plist") {
keys = NSDictionary(contentsOfFile: path)
}
if let dict = keys {
// variablize our https path with API key, recipient and message text
let mailgunAPIPath = dict["mailgunAPIPath"] as? String
let emailRecipient = "[email protected]"
let emailMessage = "Testing%20email%20sender%20variables"
// Create a session and fill it with our request
let session = NSURLSession.sharedSession()
let request = NSMutableURLRequest(URL: NSURL(string: mailgunAPIPath! + "from=FBOGo%20Reservation%20%[email protected]<my domain>.com%3E&[email protected]<my domain>.com&to=\(emailRecipient)&subject=A%20New%20Reservation%21&text=\(emailMessage)")!)
// POST and report back with any errors and response codes
request.HTTPMethod = "POST"
let task = session.dataTaskWithRequest(request, completionHandler: {(data, response, error) in
if let error = error {
print(error)
}
if let response = response {
print("url = \(response.URL!)")
print("response = \(response)")
let httpResponse = response as! NSHTTPURLResponse
print("response code = \(httpResponse.statusCode)")
}
})
task.resume()
}
Mailgunのパス値でmailgunAPIPathと呼ばれる文字列としてKeys.plistにあります。このことができます
https://API:key-<my key>@api.mailgun.net/v3/<my domain>.com/messages?
願っています!
https://omarmetwally.quora.com/Integrating-the-Fitbit-API-in-iOS-apps – 7vikram7
@ 7vikram7私もそれを見ましたが、私はまだそれを取得していません –