Piroro-hs / react-native-twitter

A Twitter API client library for React Native. Currently not maintained as my main motivation of creating this library was to use the User Streams API.
MIT License
39 stars 20 forks source link

Problems Uploading Images #18

Open Nikiforos86 opened 6 years ago

Nikiforos86 commented 6 years ago

Hello, i am trying to upload an image to Twitter using your library. i did read your solution here but it does not work. Having some more read into your code i understand that only the old method from here is supported and not the new one, but even so i could not upload an image.

I tried to implement the chunked method on my own, and started by doing something like client.rest.post('media/upload', {command:"INIT", total_bytes:"70456", media_type:"image/jpeg"}).then((resolve) => { alert('media/upload '+ JSON.stringify(resolve)) console.log('done'); }).catch(console.error); but nothing is returned. Still, if i use an alert after response.text() on raw.js of the included libraries i do get the response.

I am fairly new to React-Native (and JS) so, could ypu please provide a better example, or a way to actually retrieve the response there and chain it with the APPEND and FINISH methods?

Thanks in advance

emachalan-redblox commented 1 year ago

@Nikiforos86 Am also trying to upload video/image, but it still showing error like => media parameter is missing. Anyone please help me to overcome this issue