ParseReact icon indicating copy to clipboard operation
ParseReact copied to clipboard

Render image from Parse

Open gundam-wing opened this issue 10 years ago • 2 comments

Using react native I am able to select an image from the camera roll and successfully upload it to Parse. However, I am having trouble retrieving that same image from Parse and rendering it in a new view. I am able to retrieve other fields like so: this.data.user.phone but setting the image uri to this.data.user.image isn't successful.

I am uploading the image like this:

var image = 'data:image/png;base64,' + this.state.avatarSource;
var imageFile = new Parse.File("avatar.jpg", {base64: image});
return imageFile.save().then(function () {
    return ParseReact.Mutation.Set(this.data.event[0], {'image':imageFile}).dispatch();
 }

gundam-wing avatar Nov 18 '15 17:11 gundam-wing

Hi, why do you do ParseReact.Mutation after a save?

es6Test avatar Nov 19 '15 13:11 es6Test

You know I'm not really sure why I'm doing that other than that I stumbled across that snippet of code, used it, and it seemed to work.

gundam-wing avatar Nov 19 '15 16:11 gundam-wing