NativeScript / nativescript-background-http

Background Upload plugin for the NativeScript framework
Apache License 2.0
101 stars 50 forks source link

Since upgrading to NS6 - I can no longer get response headers in ios #233

Closed geoffbullen closed 4 years ago

geoffbullen commented 4 years ago

I have been getting the response headers like this in ios.

Since upgrading to nativescript 6, e.object.ios.response is undefined. Anyone else experienced this problem?

let myDict = e.object.ios.response.allHeaderFields; myDict.enumerateKeysAndObjectsUsingBlock(function (k, v) { if (k === "Operation-Location") result = v; }) return result;

geoffbullen commented 4 years ago

It was an issue with the latest version of nativescript, I resolved by changing to

           let myDict: NSMutableDictionary = e.response.performSelector("allHeaderFields");              
            myDict.enumerateKeysAndObjectsUsingBlock(function (k, v) {
                if (k == "Operation-Location") result = v;
            **})**