NativeScript / NativeScript/plugins
[background-http] events not fired on device
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 206
- Forks
- 123
- Avg merge
- 2d 1h
- Merged PRs (30d)
- 1
Description
Hi,
I try to upload an image to a Server via backtround-http. It works correct on android and on iOS-Simulator, but on a real iOS-device, the task-events are not fired.
-
"@nativescript/ios": "8.1.0", -
"@nativescript/background-http": "^5.0.2", -
"@nativescript/core": "~8.1.5",
Simulator: iOS 15.2
Device: iOS 15.2.1
const bghttp = require("@nativescript/background-http");
let session = bghttp.session("file-upload");
let request = {
url: this.backendURL + "images/",
method: "POST",
headers: imageHeaders,
description: "multipart/form-data",
}
let params = [
{ name: "file", filename: imagePath, mimeType: "image/png" }
];
let task = session.multipartUpload(params, request);
task.on("progress", function(e) {
console.log("uploaded " + e.currentBytes + " / " + e.totalBytes);
});
task.on("error", function(e) {
console.log("error!");
console.log(e);
console.log(e.response);
});
task.on("responded", function(request) {
console.log("responded");
}
Any ideas?
I can not reproduce it on severall smartphones/ipads, but have one device with this behavior...
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the multipart upload on a real iOS device using the listed NativeScript, iOS, and background-http versions, then compare its progress, error, and responded callbacks with the simulator. Done means identifying why task events are absent on the affected device and confirming the callbacks behave correctly for the upload.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- ios, javascript, typescript
- Domain
- mobile, networking
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100