netfox
netfox copied to clipboard
Upload Progress Method from Alamofire don't called when use netfox
Describe the bug
I use Alamofire for network request & netfox for logging the request.
The uploadProgress closure never gets called if I enable the netfox like so NFX.sharedInstance().start() in AppDelegate.
AF.upload(multipartFormData: { (multipartFormData) in
multipartFormData.append(fileUrl, withName: "file")
multipartFormData.append("\(id)".data(using: String.Encoding.utf8, allowLossyConversion: false)!, withName: "customer_id")
}, to: Constants.kAddMedia, headers: Constants.kHeaders)
.uploadProgress { (prgs) in
progress(Float(prgs.fractionCompleted))
}
.responseJSON { response in
// do my stuff
}
}
Enviroment:
- Device: [e.g. iPhone 7]
- OS: [e.g. iOS 15.1]
- Netfox version: [e.g 1.20.0]
- Alamofire version: [e.g 5.4]
- Xcode version: [e.g 13.2.1]
- Swift version: [e.g 5]
Additional context here is the link to the issue from Alamofire
Same here. When I deintegrate Netfox pod, everything works.
Thanks for the report. Will check as soon as possible.
It's been more than a year, has this issue been fixed?
Yes it's been fixed @renanstig
I am using 1.21.0 version of netfox and 5.6.4 of Alamofire, in the below progress handler doesnt get called
` AF.upload(multipartFormData: { formData in
for (key, value) in formFields {
if let data = value.data(using: .utf8) {
formData.append(data, withName: key)
}
}
formData.append(url, withName: formFields["name"] ?? "attachment")
}, with: request).uploadProgress { progress in
progressHandler?(progress.fractionCompleted)
}.responseData
`
I am using 1.21.0 version of netfox and 5.6.4 of Alamofire, in the below progress handler doesnt get called
` AF.upload(multipartFormData: { formData in
for (key, value) in formFields { if let data = value.data(using: .utf8) { formData.append(data, withName: key) } } formData.append(url, withName: formFields["name"] ?? "attachment") }, with: request).uploadProgress { progress in progressHandler?(progress.fractionCompleted) }.responseData`
Unfortunately I have faced the same issue as you, even though they say the problem is fixed, it isn’t
my workaround to it was to deactivate Netfox before the upload starts and then restart it after it’s done