react-native-tus-client icon indicating copy to clipboard operation
react-native-tus-client copied to clipboard

App will cashed on start of uploading in IOS

Open iqbalfaisal opened this issue 5 years ago • 3 comments

App will cashed during uploading in IOS

Simulator Screen Shot - iPhone 11 - 2020-02-14 at 14 24 00

iqbalfaisal avatar Feb 14 '20 09:02 iqbalfaisal

@vinzscam are you there?

iqbalfaisal avatar Mar 03 '20 04:03 iqbalfaisal

Hi, could you please attach a snippet of your code? Otherwise it's hard to reproduce the issue.

vinzscam avatar Mar 15 '20 15:03 vinzscam

@vinzscam here's my code.

 const upload = new Upload(file.path || file.uri, {
      headers: Api.headers(),
      endpoint: url,
      retryDelays: [0, 1000, 3000, 5000, 10000, 15000, 20000],
      resume: true,
      metadata: {
        filename: file.fileName ? file.fileName : `${type}.${extension}`,
        filetype: type /* for video fileType : 'video' othervise 'photo' */,
        album: alias,
        default: type != 'video' ? (profile_picture_id ? 1 : 0) : 0,
      },

      onError: error => {
        this.setState({
          modalVisible: false,
        });
        if (error?.originalRequest?._response) {
          Toast.show(JSON.parse(error.originalRequest._response).message, {
            duration: Toast.durations.LONG,
            position: Toast.positions.CENTER,
          });
        }
      },
      onProgress: (uploadedBytes, totalBytes) =>
        this.uploadingProgress(uploadedBytes, totalBytes),
      onSuccess: () => this.onUploadingComplete(type),
    });
    upload.start();

iqbalfaisal avatar Mar 16 '20 04:03 iqbalfaisal