Share Plugin Image Not Appearing (js + creator)

Hi, I’m trying to use the SDKBOX share plugin to share an image. At first I had issues saving the image on the external root directory but after getting the proper permissions(external read and write), I was able to save it on root so I thought I would just be just specifying the path to make things work. I also added fileproviders in manifest and code as per docs.

I tried native share and no apps appear so I believe It’s just an issue with the plugin not knowing what type of file I’m passing (I appended .png to the file name on save and I used jsb.saveImageFile for this). Is there anyway to force and specify the file type? I tried prefixing with file:// but it didn’t work.

A share plugin without image share seems useless. I hope someone can help.

Tagging @yinjimmy for further clarifications since upon further investigation I think the SDKBOX share plugin is just not setting the correct intent type so the Android system does not know which apps can handle the file type. Here’s a screenshot - native share without app selection:

Is there any way to specify the intent/content type directly or is this something only code under the SDKBOX hood will be able to address?

can you try this?

const shareInfo = {};
shareInfo.image = this.captureScreenFilePath;
shareInfo.link = "www.sdkbox.com";
sdkbox.PluginShare.nativeShare(shareInfo);
`
https://github.com/sdkbox/sdkbox-sample-ccc200/blob/socialshare/assets/Script/HelloWorld.js#L123

Hi @htlxyz,

Thanks for your time. Upon further investigation, SDKBOX share plugin actually works correctly but my phone can’t seem to display the apps in the sharesheet when the app is in landscape mode. On portrait mode, it works properly.

I would just like to hear from the SDKBOX team why we can’t just use internal files for sharing? Ideally we should just pass in jsb.getWritablePath() + filename to the SDKBOX API. Is it a cross-platform issue or is it a problem when using the non-native share methods (SMS, Twitter, FB) having no permissions to access the photos in the apps storage space?

Thrid app have no permission to access internal files

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.