jnordberg / dsteem

Steem blockchain RPC client
https://jnordberg.github.io/dsteem/
Other
82 stars 57 forks source link

Error occuredTypeError: Network request failed #68

Open alpertayfun opened 3 years ago

alpertayfun commented 3 years ago

Hello,

I've got this messages only on Android side. I've running on iOS devices with no errors. What is that ?

I'm using react-native and expo together. I've just get this error in only Android devices and emulator. I've checked network and other issues. Internet reachable. Network reachable.

    const client = new Client('https://api.steemit.com');

      const query = {
          tag: '',
          limit: limit,
      };
      client.database
          .getDiscussions("trending", query)
          .then(result => {

              //var posts = [];
              result.forEach(post => {
                  const json = JSON.parse(post.json_metadata);
                  const image = json.image ? json.image[0] : '';
                  const title = post.title;
                  const author = post.author;
                  const created = new Date(post.created).toDateString();
                  const last = {json:json,image:image,title:title,author:author,created:created};
                  //posts.push({last});
              });
              //console.log(result);
              this.setState({
                  dataSource: result
              });
            this.setState({isLoading:false});
          })
          .catch(err => {
            console.log('Error occured' + err);
          });