davejohnson/phonegap-plugin-facebook-connect — Issue #66: Uploading photo via byte array/data url from canvas (iOS 5)
Author: thez0rk
Created: 2011-11-30 18:27:33+00:00
State: open

I'm attempting to export the data from an HTML5 canvas (either as a data URL or a blob) and post it to facebook.

```javascript
var bytes;
canvas.toBlob(function(blob){ bytes = blob; });
var body = 'Test';
FB.api('/me/photos', 'post', { name: body, picture:bytes }, function(response) {
if (!response || response.error) {
alert(response.error);
} else {
alert('Post ID: ' + response.id);
}
});

} else {
alert('not logged in');
}
},
{ perms: "email, publish_stream" }
);
'''
I'm receiving an error: 'com.phonegap.facebook.Connect2 = TypeError: 'undefined' is not an object'

Unfortunately the graph API seems to be horribly documented....so I'm not sure where to go. I'm able to upload a photo by simply passing a URL, but using a data url or a blob results in this error. Any ideas?