Get Image Data from Screenshot
When creating an iAd, there doesn't seem to be a way to get the image data from a image that the user as created via a screenshot because of the cross domain ruling with canvas elements and images (the image from the screenshots get loaded in with an iad-image://{{project}}/{{random string}} url.
I am trying to send a screenshot of the iAd to Twitter as an attachment, however, I am getting a URL Invalid Error. I believe the only URL protocols that are allowed are http(s): and data, and the screenshot from iAd is a iad-image: protocol.
//screenshot action
this.imageActionDidComplete = function (action) {
var image = iAd.Image.imageForURL(action.url);
var message = new iAd.TwitterMessage({
body: 'Some body',
attachments: [
{type: 'image', url: action.url, name: 'ImageUrl.png'}
]
}, self);
// errors with iAd.URLResourceError.INVALID_URL_ERROR
message.presentWhenReady();
}
Is there a way to get the raw image data without the cross-domain canvas errors?
**edited for formatting**