title: RN-fetch-blob bad base64 - android only issue
body: <p>I am having an issue within react native where I am downloading a base 64 string from an API and rendering it as a PDF on mobile devices.</p>
  <p>The project is built with React native - the code works fine on iOS but on Android we are getting a 'bad base 64' / invalid PDF format error.</p>
  <p>Code:</p>
  <pre><code>//fetch on button click
   getBill = () =&gt; {
      if (Platform.OS === &quot;android&quot;) {
        this.getAndroidPermission();
      } else {
        this.downloadBill();
      }
    };
  
  //check user has permissions on device (only for android)
  getAndroidPermission = async () =&gt; {
      try {
        const granted = await PermissionsAndroid.request(
          PermissionsAndroid.PERMISSIONS.WRITE_EXTERNAL_STORAGE
        );
        const grantedRead = await PermissionsAndroid.request(
          PermissionsAndroid.PERMISSIONS.READ_EXTERNAL_STORAGE
        );
  
        if (
          granted === PermissionsAndroid.RESULTS.GRANTED &amp;&amp;
          grantedRead === PermissionsAndroid.RESULTS.GRANTED
        ) {
          this.downloadBill();
        } else {
          Alert.alert(
            &quot;Permission Denied!&quot;,
            &quot;You need to give storage permission to download the file&quot;
          );
        }
      } catch (err) {
        console.warn(err);
      }
    };
  
  //download and display bill
  downloadBill = async () =&gt; {
      this.setState({ loading: true });
      let billId = this.state.billId;
      let user = await AsyncStorage.getItem(&quot;user&quot;);
      let parseUser = JSON.parse(user);
      let userToken = parseUser.token;
  
      RNFetchBlob.config({
        addAndroidDownloads: {
          useDownloadManager: true,
          notification: true,
          path:
            RNFetchBlob.fs.dirs.DownloadDir +
            &quot;/&quot; +
            `billID_${this.state.billId}.pdf`,
          mime: &quot;application/pdf&quot;,
          description: &quot;File downloaded by download manager.&quot;,
          appendExt: &quot;pdf&quot;,
          trusty: true,
        },
      })
        .fetch(&quot;GET&quot;, `${config.apiUrl}/crm/getbillfile/${billId}`, {
          Authorization: &quot;Bearer &quot; + userToken,
        })
        .then((resp) =&gt; {
          let pdfLocation =
            RNFetchBlob.fs.dirs.DocumentDir +
            &quot;/&quot; +
            `billID_${this.state.billId}.pdf`;
  
          RNFetchBlob.fs.writeFile(pdfLocation, resp.data, &quot;base64&quot;);
  
          FileViewer.open(pdfLocation, {
            onDismiss: () =&gt; this.setState({ loading: false }),
          });
        });
    }; 
  </code></pre>
  <p>Android manifest:</p>
  <pre><code>&lt;uses-permission android:name=&quot;android.permission.WRITE_EXTERNAL_STORAGE&quot; /&gt;
    &lt;uses-permission android:name=&quot;android.permission.READ_EXTERNAL_STORAGE&quot; /&gt;
    &lt;uses-permission android:name=&quot;android.permission.DOWNLOAD_WITHOUT_NOTIFICATION&quot; /&gt; 
    &lt;intent-filter&gt;
      &lt;action android:name=&quot;android.intent.action.MAIN&quot; /&gt;
      &lt;category android:name=&quot;android.intent.category.LAUNCHER&quot; /&gt;
      &lt;action android:name=&quot;android.intent.action.DOWNLOAD_COMPLETE&quot;/&gt;
    &lt;/intent-filter&gt;
  </code></pre>
  <p>Any help would be appreciated</p>