I am working on building a system that allows user to share a link on Facebook/twitter and get items in return. When I tap my facebook share button or twitter share button it pulls up the Android native “share via: window” with numerous options. For example: bluetooth, copy to clipboard, drive, email, flipboard, gmail, facebook, twitter, etc… So… if I click on my facebook share button, I get the native share window… then if for instance I click on copy to clipboard, my facebook listener fires with the following event.type == social, event.popup, event.action == sent. So my question… is there a way to differentiate which “share via option” the user clicks. Seems to me that the user can just copy to clipboard instead of sharing to facebook and get rewarded for it. What am I missing?
Running 2014.2511
Here is my code.
local function facebookListener(event) print("Facebook listener is active") for k,v in pairs( event ) do print( k,v ) -- k=key, v=value end end local function twitterListener(event) print("Twitter listener is active") for k,v in pairs( event ) do print( k,v ) -- k=key, v=value end end local function fbShareForCharge(event) if event.phase == "began" then print("sharing for charge") local isFacebookAvailable = native.canShowPopup( "social", "facebook" ) if isFacebookAvailable == true then local options = { service = "facebook", -- message = "nothing", listener = facebookListener, url = "www.somethingToShare.com" } native.showPopup( "social", options ) end end end local function twitterShareForCharge(event) if event.phase == "began" then print("sharing twitter for charge") local isTwitterAvailable = native.canShowPopup( "social", "twitter" ) if isTwitterAvailable == true then local options = { service = "twitter", message = "Check out my game on the Google Play Store!", listener = twitterListener, url = "www.sharethis.com" } native.showPopup( "social", options ) end end end