iOS10 Post request - error return

Hi,
After iOS10 launched my app stopped to work in iOS. In Android it works well with the endpoints that I am using in the current iOS version.

But when I try to make a request the following json message erros is shown:

{
	"data": null,
	"status": -1,
	"config": {
		"method": "POST",
		"transformRequest": [null],
		"transformResponse": [null],
		"url": "https://xxxx.com.br",
		"data": {
			"Serial": "xxxxx",
			"Pin": "xxxxx"
		},
		"headers": {
			"Content-Type": "application/json",
			"Accept": "application/json"
		},
		"cached": false
	},
	"statusText": ""
}

I’ve tried everything, but nothing has worked. Since CSP (Content-Security-Policy) in the index.html, App Transport Security Settings, even Cross Script in the server side.

it’s important to know that the application works well in android. it’s just in iOS.

If anyone could help, it would be amazing, I’m stuck in this issue for 3 days.

Thanks in advance.
Best Regards.

Make all endpoints https instead of http.

Hi, they already are https.

Did you remote debug the error on the device already?
https://ionic.zone/debug/remote-debug-your-app#ios
Look at the console logs and network requests (and anything else strange of course)

1 Like

Thanks Sujan, the suggestion you gave, help me to find the real issues.

Failed to load resource: Origin null is not allowed by Access-Control-Allow-Origin: null

the issue was in this plugin https://github.com/apache/cordova-plugin-wkwebview-engine

I did remove the iOS platform and added again following the plugin above and it worked again.

seems like the version I was using had the bug, so remove and reinstall the plugin was enough.

Thanks for the help.

Best Regards

1 Like