03-09-2013 06:35 PM
I'm trying to share a picture that's stored remotely on a server through Facebook. I can share a locally stored picture using -
navigator_invoke_invocation_t *iRequest = NULL; navigator_invoke_invocation_create(&iRequest); navigator_invoke_invocation_set_action(iRequest, "bb.action.SHARE"); navigator_invoke_invocation_set_target(iRequest,"F
acebook"); char cwd[PATH_MAX]; char file[PATH_MAX]; getcwd(cwd, PATH_MAX); snprintf(file, PATH_MAX, "file://%s/app/native/assets/picture.png", cwd); navigator_invoke_invocation_set_uri(iRequest,file) ; navigator_invoke_invocation_send(iRequest); navigator_invoke_invocation_destroy(iRequest);
However, it doesn't seem to work if I use a http:// as the URI
So, as an alternative I tried to load the image data from the server and to share it by replacing the set_uri command with
navigator_invoke_invocation_set_data(iRequest, data, dataLen); navigator_invoke_invocation_set_type(iRequest, "image/jpeg");
But that didn't work, either.
Has anyone successfully managed to share a picture either from a remote server or from image data in memory? If so, can they point out where I'm going wrong please?