alamofire

Alamofire not handling Authentication challenge

回眸只為那壹抹淺笑 提交于 2019-12-22 09:03:13
问题 Utilizing Alamofire, Im noticing that the code below isn't being hit with a breakpoint. I make a connection, and I get the following error: (Error Domain=NSURLErrorDomain Code=-1200 "An SSL error has occurred and a secure connection to the server cannot be made." UserInfo=0x1741b3f60 {_kCFStreamErrorCodeKey=-9806, NSLocalizedRecoverySuggestion=Would you like to connect to the server anyway?, NSUnderlyingError=0x17484b8e0 "The operation couldn’t be completed. (kCFErrorDomainCFNetwork error

Alamofire upload huge file

我只是一个虾纸丫 提交于 2019-12-22 08:57:37
问题 I am using Alamofire to upload assets (image/video) as multipart form data. It works fine for file sizes below 300MB (app). When I try to upload a file greater than 300MB, app crashes. if let video = self.avPlayerItem?.asset as? AVURLAsset { if let assetData = NSData(contentsOfURL: video.URL) { multipartFormData.appendBodyPart(data: assetData, name: "file", fileName: "video", mimeType: "video/mp4") // Execution stops here } } I also get the below message from Xcode How would I support

Alamofire Swift get html source

自作多情 提交于 2019-12-22 08:13:22
问题 I just want to retrieve the html source from a simple website. @IBAction func scan_func(sender: AnyObject) { Alamofire.request(.GET, "http://www.example.com") .response { request, response, data, error in print(request) print(response) print(data) } } I already have successfully added "App Transport Security Settings" and "Allow Arbitrary Loads" to info.plist to load http content. When I run that code I only get an output like this: XCODE - hexadecimal output I hope you can help me. kind

Alamofire Swift 2 - cannot submit for beta testing (Xcode 7 GM)

假装没事ソ 提交于 2019-12-22 07:04:48
问题 I have followed the instructions on installing the swift2 branch of Alamofire with cocoa pods. The app works well in the simulator, however, when I archive it for submission with Xcode 7 GM I receive an email with an error: "The bundle contains an invalid implementation of Swift. The app may have been built or signed with non-compliant or pre-release tools" This issue definitely relates to the framework as without it I am able to submit for beta testing with the same version of Xcode. I have

Alamofire Not Working Properly - Tuple Issue Different number of elements

為{幸葍}努か 提交于 2019-12-22 05:34:55
问题 Using Xcode 7.1 In the Alamofire responseJSON request I cannot put 4 parameters. Below is the code let url2 = "https://httpbin.org/get" Alamofire.request(.GET, url2).responseJSON{ request, response, JSON, error in print(JSON) } I get this error: Tuple types '(NSURLRequest?, NSHTTPURLResponse?, Result)' (aka '(Optional, Optional, Result)') and '(_, _, _, _)' have a different number of elements (3 vs. 4) If I remove the " error " parameter from responseJSON and run it...the app builds but no

Insert a comment using the YouTube API and Alamofire

馋奶兔 提交于 2019-12-22 05:18:15
问题 Thanks for taking the time to read this. I'm confused on how to insert a comment using the YouTube API. I'm fairly new to using APIs, so I don't quite get what they are saying to do in their documentation. I've authenticated the user using Google Sign-In for iOS with the scope "https://www.googleapis.com/auth/youtube.force-ssl" which is required to insert a comment. But now, I have to actually insert the comment and (like I've said) I don't understand how to do that because I have to provide

How to sort JSON coming from Alamofire and return final JSON object (swiftyJSON)

怎甘沉沦 提交于 2019-12-21 22:17:31
问题 I'm having trouble succinctly pulling data from an api, adding the users current location into the object and then sorting the data based on the calculated distance. The stackoverflow questions don't quite answer the problem I'm facing. See here: How to sort posts read from JSON server file in Swift. I'm currently loading api data from Alamofire and rendering that data with a UITableViewController. override func viewDidLoad() { super.viewDidLoad() titleLabel.title = q.capitalizedString

ios 8, Swift, receipt validation for IAP

自闭症网瘾萝莉.ら 提交于 2019-12-21 20:24:37
问题 i'm desperately trying to validate a receipt for in-app in a futur IOS application written with Swift, IOS8.1 I'm using the Alamofire framework to compensate a bug in NSURLConnection for swift but still not having any return from the Apple Server. func checkReceipt(data:NSData) { let ITMS_PROD_VERIFY_RECEIPT_URL = "https://buy.itunes.apple.com/verifyReceipt" let ITMS_SANDBOX_VERIFY_RECEIPT_URL = "https://sandbox.itunes.apple.com/verifyReceipt" let base64String = self.base64forData(data) if

Alamofire with custom parameter encoding for swift application

為{幸葍}努か 提交于 2019-12-21 20:05:11
问题 I have to call some methods from the soap web service in my swift application, so I think I should use custom parameter encoding, but when I create closure for this encoding it seems never to be called. Am I doing something wrong? Here is my code: let custom: (URLRequestConvertible, [String: AnyObject]?) -> (NSURLRequest, NSError?) = { (URLRequest, parameters) in let mutableURLRequest = URLRequest.URLRequest.mutableCopy() as NSMutableURLRequest mutableURLRequest.setValue("text/xml; charset

How to cancel Alamofire.upload

情到浓时终转凉″ 提交于 2019-12-21 07:56:42
问题 I am uploading images on server via Alamofire.upload as multipart data. Unlike Alamofire.request it's not returning Request object, which I usually use to cancel requests. But it's very reasonable to be able to cancel such a consuming requests like uploading. What are the options for this in Alamofire? 回答1: Using the Uploading MultiPartFormData example from the Alamofire README: Alamofire.upload( .POST, "https://httpbin.org/post", multipartFormData: { multipartFormData in multipartFormData