-
Notifications
You must be signed in to change notification settings - Fork 1.2k
ipfs.cat returns "undefined" in React-native #3076
Comments
Thank you for submitting your first issue to this repository! A maintainer will be here shortly to triage and review.
Finally, remember to use https://discuss.ipfs.io if you just need general support. |
I tried to import and use the "ipfs-http-client" in my react native app.js. However, I got the following error: "error: not implemented" I am using "ipfs-http-client": "^42.0.0", "node-libs-react-native": "^1.2.0", "react": "16.11.0", "react-native": "0.62.2", – I do not know why I am getting this error. Has anyone got this error before? |
Please can you post your updated code? The API has changed significantly between Notably in the original example you're using callbacks and the updated version is all async/await. |
@ZTECH10 have a look at https://github.com/ipfs-shipyard/react-native-ipfs-demo. There are instructions over there that go into detail on how to get the HTTP client up and running in a React Native app. Feel free to play around with the demo. If then you still run into issues, please let us know. |
@achingbrain maybe we can close this for the time being? This issue is one year old too. |
Agreed, I think we're good to close now there's a demo with instructions of how to get the http client working on RN. Thanks! |
Severity:
Description:
On React-native: When I add a buffered string(i.e. Buffer(str) ) to IPFS using ipfs.add, the buffered string is added successfully and IPFS returns the hash.
When I try to retrieve the buffered string via ipfs.cat, ipfs.cat returns "undefined".
On Node.jS and ReactJs: I do not have this problem. Both ipfs.add and ipfs.cat works.
Is the problem related to pinning in IPFS? would changing the ipfs-api version in packag.json help? would changing the cat.js help ?
Steps to reproduce the error:
When I run the app.js file, I get the above error (ipfs.cat return "undefined")
The text was updated successfully, but these errors were encountered: