Hi Friends,
Would you please guide me on how can I display the default share dialog for Android which displays all social network apps the user wants to select one to do the share.
Thanks,
Hi Friends,
Would you please guide me on how can I display the default share dialog for Android which displays all social network apps the user wants to select one to do the share.
Thanks,
See the “Social Popup” plugin:
https://docs.coronalabs.com/plugin/CoronaProvider_native_popup_social/index.html
Rob
Many thanks, I have tried below code related to Social popup plugin on Android and I have got the default share dialog for Android even I specified the Facebook service in my parameters, now my question is what if I need to directly post to Facebook without allowing the user to choose the social network and my other point is can I get a callback once the user did the post in order to reward him later.
ocal serviceName = “twitter” – Supported values are “twitter”, “facebook”, or “sinaWeibo”
local isAvailable = native.canShowPopup( “social”, serviceName )
if ( isAvailable ) then
local listener = {}
function listener:popup( event )
print( "name: " … event.name )
print( "type: " … event.type )
print( "action: " … tostring( event.action ) )
print( "limitReached: " … tostring( event.limitReached ) )
end
native.showPopup( “social”,
{
service = serviceName,
message = “Hi there!”,
listener = listener,
url =
{
}
})
else
native.showAlert(
“Cannot send " … serviceName … " message.”,
“Please setup your " … serviceName … " account or check your network connection.”,
{ “OK” } )
end
Looks like our docs are missing something. Consider this code:
local listener = {} function listener:popup( event ) print( "name(" .. event.name .. ") type(" .. event.type .. ") action(" .. tostring(event.action) .. ") limitReached(" .. tostring(event.limitReached) .. ")" ) end local thisScore = 1000 -- Show the popup native.showPopup( popupName, { service = "share", -- The service key is ignored on Android. message = "I scored " .. thisScore .. " by saving the planet from the killer enemies!", listener = listener, image = { { filename = "Icon.png", baseDir = system.ResourceDirectory }, }, url = { "http://www.somesite.com/", } })
The “share” option is actually documented in the “canShowPopup” docs.
This should show a singular dialog box with available ways to share items. Don’t specify specifics like twitter or facebook.
Rob
Thanks Rob for your support.
What I need now is how to specify specific social engine like Facebook or Twitter while doing my sharing, and how then I can catch the callback in order to do a reward for the user.
Regards,
Hi Irfan,
I need to do the sharing using Corona SDK, however, the page that you shared with me related to Android native code.
If you need Twitter or Facebook-specific features, you should implement the Facebook Plugin and look at the Twitter plugin from the marketplace.
The share plugin does have a call back when it’s finished. There is information returned, but I’m not sure what all values are returned. You can use one of several different table printing techniques to dump the event table is returned. There may be useful information there for you.
Rob
See the “Social Popup” plugin:
https://docs.coronalabs.com/plugin/CoronaProvider_native_popup_social/index.html
Rob
Many thanks, I have tried below code related to Social popup plugin on Android and I have got the default share dialog for Android even I specified the Facebook service in my parameters, now my question is what if I need to directly post to Facebook without allowing the user to choose the social network and my other point is can I get a callback once the user did the post in order to reward him later.
ocal serviceName = “twitter” – Supported values are “twitter”, “facebook”, or “sinaWeibo”
local isAvailable = native.canShowPopup( “social”, serviceName )
if ( isAvailable ) then
local listener = {}
function listener:popup( event )
print( "name: " … event.name )
print( "type: " … event.type )
print( "action: " … tostring( event.action ) )
print( "limitReached: " … tostring( event.limitReached ) )
end
native.showPopup( “social”,
{
service = serviceName,
message = “Hi there!”,
listener = listener,
url =
{
}
})
else
native.showAlert(
“Cannot send " … serviceName … " message.”,
“Please setup your " … serviceName … " account or check your network connection.”,
{ “OK” } )
end
Looks like our docs are missing something. Consider this code:
local listener = {} function listener:popup( event ) print( "name(" .. event.name .. ") type(" .. event.type .. ") action(" .. tostring(event.action) .. ") limitReached(" .. tostring(event.limitReached) .. ")" ) end local thisScore = 1000 -- Show the popup native.showPopup( popupName, { service = "share", -- The service key is ignored on Android. message = "I scored " .. thisScore .. " by saving the planet from the killer enemies!", listener = listener, image = { { filename = "Icon.png", baseDir = system.ResourceDirectory }, }, url = { "http://www.somesite.com/", } })
The “share” option is actually documented in the “canShowPopup” docs.
This should show a singular dialog box with available ways to share items. Don’t specify specifics like twitter or facebook.
Rob
Thanks Rob for your support.
What I need now is how to specify specific social engine like Facebook or Twitter while doing my sharing, and how then I can catch the callback in order to do a reward for the user.
Regards,
Hi Irfan,
I need to do the sharing using Corona SDK, however, the page that you shared with me related to Android native code.
If you need Twitter or Facebook-specific features, you should implement the Facebook Plugin and look at the Twitter plugin from the marketplace.
The share plugin does have a call back when it’s finished. There is information returned, but I’m not sure what all values are returned. You can use one of several different table printing techniques to dump the event table is returned. There may be useful information there for you.
Rob