Sure I can consider using your IOS library. But without a trial, I wonder if it will works on my App. I am using the following code. Can you let me know what’s wrong
NSString *token = [[[[deviceToken description]
stringByReplacingOccurrencesOfString: @”<” withString: @””]
stringByReplacingOccurrencesOfString: @”>” withString: @””]
stringByReplacingOccurrencesOfString: @” ” withString: @””];
NSString *postString = @”[email protected]&os=iOS&token=”;
postString = [postString stringByAppendingString:token];
NSData *postData = [postString dataUsingEncoding:NSASCIIStringEncoding allowLossyConversion:true];
NSString *postLength = [NSString stringWithFormat:@”%d”, [postData length]];
NSMutableURLRequest *request = [[NSMutableURLRequest alloc] init];
[request setURL:[NSURL URLWithString:@”https://myweb.com/pnfw/register/”%5D%5D;
[request setHTTPMethod:@”POST”];
//[request setValue:postLength forHTTPHeaderField:@”Content-Length”];
[request setValue:@”application/x-www-form-urlencoded” forHTTPHeaderField:@”Content-Type”];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *postDataTask= [session dataTaskWithRequest: request completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse*) response;
int statusCode = (int)[httpResponse statusCode];
statusCode = statusCode;
}];
[postDataTask resume];