http icon indicating copy to clipboard operation
http copied to clipboard

Unable to retrieve local file

Open shifenis opened this issue 3 years ago • 0 comments

Bug description

I'm trying to use my local file (inside assets folder) as a service mock, but I can't retrieve any data from it.

iOS

During the test on the iOS device, I'm unable to catch any error

Android

During the test on the Android device I facing off two types of errors:

  • without file:// I get MalformedURLException;
  • adding file:// to my current URL I get a CastExpection

Steps to reproduce

  • Add a JSON file inside your assets;
  • Make a Get with the package pointing on the file, in my case:
    return from(Http.get({ url: `file://assets/demo/getProfile.json` })).pipe(
      map(response => response.data),
    );

Expected behavior

From both platforms, I expect to get value from my JSON (as HttpService from `Angular. On the iOS side, I even expect to catch some errors.

Tested on

iOS

  • Device: iPhone 12
  • OS: 15.3

Android

  • Device: A52s
  • OS: Android 11

shifenis avatar Feb 15 '22 15:02 shifenis