I tried to post device token and device details to a web service using almofire. But I am getting response like the following
UserInfo={NSUnderlyingError=0x7fba3a590e50 {Error Domain=kCFErrorDomainCFNetwork Code=-1022 "(null)"}, NSErrorFailingURLStringKey=http://----/register, NSErrorFailingURLKey=http://---/register, NSLocalizedDescription=The resource could not be loaded because the App Transport Security policy requires the use of a secure connection.
In Objective c, I tried to set all the values as httpHeader, In swift i used the following code..
let params = ["notification_token":deviceToken,"device_identifier":deviceIdentifier,"advertising_identifier":"","model":deviceModel,"os":deviceOS,"os_version":deviceOSVersion,"app_version":deviceAppVersion]
let jsonData = try! NSJSONSerialization.dataWithJSONObject(params, options: [])
request(.POST, urlString, parameters: params,encoding:.JSON).responseJSON
{
response in
if let JSON = response.result.value
{
// print("A JSON Result :\(JSON)")
delegate.API_CALLBACK_RegisterApp!(JSON as! NSDictionary)
}
else
{
delegate.API_CALLBACK_Error(0,errorMessage: response.result.error!.description)
}
}
Please assist me..