[SOLVED] [SDKBOX - Facebook] Share image is not working!

I used cocos2d-js 3.8.1. My code uses to share an image below:

var btnShareLink = new cc.MenuItemFont(“Share Photo”, function(){
cc.log(’===== share photo ====’);
var info = new Object();
info.type = “photo”;
info.title = “My Photo”;
info.image = “res/twitter2.png”;
sdkbox.PluginFacebook.dialog(info);
}, this);

Everytimes i run this code, i got error

BitmapFactory(32315): Unable to decode stream: java.io.FileNotFoundException: res/twitter2.png: open failed: ENOENT (No such file or directory).

My image i put it on ProjectName/assets/res/twitter2.png.

So i want to khow that this code "info.image = “res/twitter2.png” is correct. Thank you very much!

is this error happens on iOS or android?

Im so sorry! Its my fault. I did wrong test case. Sorry for my question. I test in case which shares image in folder pro.android/asset/res./example.png. It cannot be shared. Image must be shared from hidden memory of android phone or something like that. Thank for your supporting! Have a nice day, @nite!

Please change it as [SOLVED]

Im sorry! I will make [SOLVED] now.

1 Like