Open matheusvps opened 8 months ago
Hello @matheusvps,
For V4, we don't listen on event.
Here is an example how we listen to the callback.
FileTransferManager.init(
{ parallelUploadsLimit: 2 },
(upload) => {...});
The callback is in the initialiser.
Hello @zfir ! Got it, did something like this :
this.uploader = FileTransferManager.init({ parallelUploadsLimit: 1 }, async event => {
console.debug('initialized');
if (event.eventId) {
console.debug('new event was fired', event);
if (event.state === 'UPLOADED') {
Vue.prototype.$event.$emit('upload-success', {
docId: event.eventId,
});
} else if (event.state === 'FAILED') {
Vue.prototype.$event.$emit('upload-error', {
docId: event.eventId,
});
} else if (event.state === 'UPLOADING') {
Vue.prototype.$event.$emit('upload-progress', {
docId: docId,
progress: Math.round(event.progress),
});
}
But when I call the .startUpload function, no events are fired, no network updates... and the uploader object is already initialized.
Hello @matheusvps,
This can be due to the payload that you are sending. Can you send a payload example.
Also to see if you are having a problem with plugin, you can use Android Studio to debug.
Hello, currently using V4 on my project. Did this :
Obs : the object uploader is initialized when my app is mounted. The acknowledgeEvent returns "sucess OK" but the "this.uploader.on(...)" returns on is not a function. I need to hear the events clearly because the startUpload is called when I click a button but my documents isn't sended and I got none on my network... Do I need to downgrade my plugin version ? How can I fix that ?