I’m trying to add a Share Screenshot button to my game, however, I can’t get the social popup to work. When the button is pressed, I save an image via display.save, then wait 100ms and bring up the social popup. But when I click an option from the popup (such as email, text, dropbox, etc) nothing happens. The popup just goes away. I don’t see any error messages in logcat or anything.
I also tried sharing an image that was bundled in the resource directory, and still nothing happens. If I set a message instead of an image, it does appear to work.
This popup seems to work fine in another Corona made app called Bubble Toad, so I know that it is possible.
@Vince_, you cannot add a local image to share. This is a big no go. You can only share images that are already on the net with Facebook. If you want to share a local image, you will need first to upload it to your server or other image server you may have access, and then use the proper URL to feed to Facebook.
@nmichaud, Thanks for the heads up. Is there documentation anywhere that says that? Regardless, I’m not only trying to share on FB. Nothing happens when I choose, email, text, Twitter, Dropbox, Hangouts…etc.
Yup its mention on the FB feed dialog section of their SDK.
You can easily set the name, description, image URL and the source URL. But depending of which parameter you use, some other parameters will be ignored.
PS: I never use native.showpopup with the “social” request. I always use the FB plugin in my app for better integration and possibilities.
Edit: Its seems I was wrong and we can post a local image with the social plugin. Sorry for the confusion here.
The social popup should allow you to share a local image. Can you produce a sample/demo app complete with main.lua, config.lua and build.settings and any assets to demo the problem and share it on DropBox or GoogleDrive with us?
I went ahead and made a barebones app to test the functionality and lo and behold it worked. So I made sure that the code was the same in my main app, and it was but still nothing would happen.
I wound up taking a look at my build.settings and found this little bugger which seemed to be preventing other apps from accessing the app’s sandbox
--REMOVE THIS IF YOU WANT TO SHARE IMAGES USING THE SOCIAL POPUP ON ANDROID allowAppsReadOnlyAccessToFiles = false,
Not sure why I added that in the first place but I have removed it and sharing works perfectly now. I can even post the image to my timeline on Facebook.
@Vince_, you cannot add a local image to share. This is a big no go. You can only share images that are already on the net with Facebook. If you want to share a local image, you will need first to upload it to your server or other image server you may have access, and then use the proper URL to feed to Facebook.
@nmichaud, Thanks for the heads up. Is there documentation anywhere that says that? Regardless, I’m not only trying to share on FB. Nothing happens when I choose, email, text, Twitter, Dropbox, Hangouts…etc.
Yup its mention on the FB feed dialog section of their SDK.
You can easily set the name, description, image URL and the source URL. But depending of which parameter you use, some other parameters will be ignored.
PS: I never use native.showpopup with the “social” request. I always use the FB plugin in my app for better integration and possibilities.
Edit: Its seems I was wrong and we can post a local image with the social plugin. Sorry for the confusion here.
The social popup should allow you to share a local image. Can you produce a sample/demo app complete with main.lua, config.lua and build.settings and any assets to demo the problem and share it on DropBox or GoogleDrive with us?
I went ahead and made a barebones app to test the functionality and lo and behold it worked. So I made sure that the code was the same in my main app, and it was but still nothing would happen.
I wound up taking a look at my build.settings and found this little bugger which seemed to be preventing other apps from accessing the app’s sandbox
--REMOVE THIS IF YOU WANT TO SHARE IMAGES USING THE SOCIAL POPUP ON ANDROID allowAppsReadOnlyAccessToFiles = false,
Not sure why I added that in the first place but I have removed it and sharing works perfectly now. I can even post the image to my timeline on Facebook.