afnetworking-3

upload Zip file in AFNetwoking 3.0

筅森魡賤 提交于 2020-01-17 03:48:26
问题 I am using AFNetworking 3.0 to upload Zip file on server but its give the below error from serverside . Code AFHTTPSessionManager *manager = [[AFHTTPSessionManager alloc] initWithBaseURL:[NSURL URLWithString:@"http://www,baseurl.com”]]; [manager.requestSerializer setValue:@“headertoeknvalue” forHTTPHeaderField:@"Authorization"]; manager.requestSerializer = [AFJSONRequestSerializer serializer]; manager.responseSerializer = [AFJSONResponseSerializer serializer]; manager.responseSerializer

iOS - (kCFStreamErrorDomainSSL, -9813)

喜夏-厌秋 提交于 2020-01-07 05:08:24
问题 I'm getting (kCFStreamErrorDomainSSL, -9813) when connecting to a client's server. The client's server has a self signed certificate that I can not change. The app is using AFNetworking 3.x. I've tried the following but nothing seems to work. If someone could help me, it will be much appreciated. Info.plist: <key>NSAppTransportSecurity</key> <dict> <key>NSAllowsArbitraryLoads</key> <true/> <key>NSTemporaryExceptionAllowsInsecureHTTPLoads</key> <true/> <key>NSExceptionDomains</key> <dict> <key

Send JSON data in URL body with AFNetworking 3.0

断了今生、忘了曾经 提交于 2020-01-06 15:32:15
问题 I want to send JSON data in URL body from my IOS app to server.I searched many SO question but i can't find what i want. If anyone knows how to do with AFNetworking then please let me know.Thanks This is my code snipped which send parameters NSMutableDictionary *parameters = [[NSMutableDictionary alloc]init]; [parameters setValue:@"PY" forKey:@"AppSecret"]; [parameters setValue:@"IOS" forKey:@"login_provider"]; [parameters setValue:_txtemail.text forKey:@"email"]; [parameters setValue:

How can I migrate in AFNetworking 3.0?

送分小仙女□ 提交于 2020-01-04 02:22:25
问题 I am migrating in AFNetworking 3.0. I am using AFHTTPRequestOperation in AFNetworking but it was removed in recent updates. I tried all the possible solution. Basically I need to post a JSON with Header. I convert my NSDIctionary into a JSON object then add it as string. Here is the sample JSON with Header of mine RequestHeader={ "lname" : "sadhsdf", "bday" : "2003-03-13", "age" : "12", "address" : "dsfhskdjgds", "gender" : "M", "cnumber" : "12312412", "fname" : "sadhsdf", "RequestType" :

AFNetworking 3.0 Multipart form data for uploading image error

£可爱£侵袭症+ 提交于 2019-12-25 09:06:30
问题 I've been trying to upload an image to my AWS server using multipart form data afnetworking 3.0 but apparently, every image I tried to upload ended up in the failure block. The codes in written in objective-c. - (NSURLSessionUploadTask *)uploadImageTask:(NSMutableDictionary *)dictionary { NSString *s3BucketUrl = [dictionary objectForKey:@"s3BucketUrl"]; NSData *imageData = [dictionary objectForKey:@"imageData"]; NSString *contentType = [dictionary objectForKey:@"contentType"]; NSString

How to send background location to server periodically if location change or not using AFN 3?

浪尽此生 提交于 2019-12-25 07:29:23
问题 i'm very new in iOS app development.I am going to use AFNetworking 3.0.I want to update location in background and send it to server. while send it to server,i want to condition: 1)if location not change i want to call service sendlocation1 2)if location change i want to call service sendlocation2. location change (near about 50 meters). Please help me.... i tried following code---- in ViewDidLoad: (void)viewDidLoad { [super viewDidLoad]; locationManager = [[CLLocationManager alloc] init];

How to send background location to server periodically if location change or not using AFN 3?

China☆狼群 提交于 2019-12-25 07:29:13
问题 i'm very new in iOS app development.I am going to use AFNetworking 3.0.I want to update location in background and send it to server. while send it to server,i want to condition: 1)if location not change i want to call service sendlocation1 2)if location change i want to call service sendlocation2. location change (near about 50 meters). Please help me.... i tried following code---- in ViewDidLoad: (void)viewDidLoad { [super viewDidLoad]; locationManager = [[CLLocationManager alloc] init];

How can I parse XML data using AFNetworking 3.0

大城市里の小女人 提交于 2019-12-25 00:02:33
问题 I am doing a simple project to display the weather report using this a link and I implemented the following code to get the result... AFHTTPSessionManager *manager = [AFHTTPSessionManager manager]; manager.responseSerializer = [AFHTTPResponseSerializer serializer]; [manager GET:@"https://graphical.weather.gov/xml/SOAP_server/ndfdXMLserver.php?wsdl" parameters:nil progress:nil success:^(NSURLSessionDataTask * task, id responseObject) { NSData * data = (NSData *)responseObject; NSLog(@"Response

How to set ticket with AFHTTPSessionOperation or AFHTTPSessionManager?

試著忘記壹切 提交于 2019-12-24 07:15:06
问题 Does anyone know how to set ticket inside AFHTTPSessionOperation? This is the previous call using AFNetworking framework 1.0 NSURLRequest* request = [self.myClient requestWithMethod:@"POST" path:[NSString stringWithFormat:@"%@/%@", controller, action] parameters:parameters]; AFHTTPRequestOperation* operation = [self.myClient HTTPRequestOperationWithRequest:request success:success failure:failure]; [self.mirrorClient enqueueHTTPRequestOperation:operation]; The ticket is stored inside the self

How to access a third party framework from My.Framework?

江枫思渺然 提交于 2019-12-24 01:28:31
问题 Steps to understand my problem: 1) I created a framework (My.framework) 2) Added My.framework as a subproject to MyApp.xcodeproj. 3) Then I ran cocoapod for adding AFNetworking on MyApp.xcodeproj. 4) Now, I open MyApp.xcworkspace. 5) While trying to access AFNetworking from classes in My.framework. It is not accessible. P.S. I am not talking about "umbrella framework". (Umbrella framework is where we add a framework as a framework of sub project.)(Correct me here if I am wrong) I just want to