Hello, I am new to corona and I am trying to use the social plugin. On the emulator I think it works fine because it shows up the warning message which is intialied in the social plugin. But when I try to run it on my phone. The app crashes.
here is my code:
local fb= widget.newButton {defaultFile = "BG.png", onRelease= fbshare} fb.x=centerX-73 fb.y= centerY+139 fb.width = 45 fb.height=50 fb.alpha=0.01 sceneGroup:insert(fb)
local function fbshare(event) print("fbshare ") audio.play(btn) audio.pause(menuMusic) --------------======================FACEBOOK INTEGRATION======================================= local serviceName = "facebook" --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! This is a test msg!.", listener = listener, image = { { filename="smoke.png", baseDir=system.ResourceDirectory }, { filename="smoke.png", baseDir=system.ResourceDirectory } }, url = { "http://www.coronalabs.com", "http://docs.coronalabs.com" } }) else native.showAlert( "Cannot send " .. serviceName .. " message.", "Please setup your " .. serviceName .. " account or check your network connection.", { "OK" } ) end --------------======================FACEBOOK INTEGRATION ENDSSSSSSSSSSSS=======================================
Please help me out. I need to complete this app asap.