Skip to content

App Closed RNFetchBlob #13

Open
Open
@muhammad-usman56

Description

@muhammad-usman56

App will be closed after clicking on the upload button when I am using RNFetchBlob when I cannot using RNFetchBlob the(Promise Unhandled Promise rejection id:0) warning will be appeared I'm using emulator iPhone 11 and working on IOS and my server is 000webhost.com

import RNFetchBlob from 'rn-fetch-blob';
uploadPic=()=>{
// alert('ddf');
RNFetchBlob.fetch('POST', 'https://drivingaidweb.000webhostapp.com/backend/image.php', {
Authorization : "Bearer access-token",
otherHeader : "foo",
'Content-Type' : 'multipart/form-data',
}, [
// element with property filename will be transformed into file in form data
{ name : 'image', filename : 'avatar.png', data: this.state.pic}
]).then((resp) => {
console.log(resp);
alert('your image uploaded successfully');
this.setState({avatarSource:null})
})
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions