dsteem
dsteem copied to clipboard
Error occuredTypeError: Network request failed
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);
});