So I am following the twitter api tutorial here: (http://coronalabs.com/blog/2013/02/11/using-the-ios-built-in-twitter-feature/) and it works and posts normally. However after I click send, twitter closes and then loads back again automatically and displays an error message on device saying " duplicate error, cannot send tweet"
How can I stop twitter loading up immediately after I post first message and stop the duplicate tweet error?
function tweetCallback( event )
transition.to(twitterbtn, {time=50, y=display.contentCenterY +120 })
if ( event.action == "cancelled" ) then
print( "User cancelled" )
else
native.showPopup( "twitter", options )
print( "Thanks for the tweet!" )
end
end
--
local options = {
message = " I scored " .. utils.highscore .. " Miles ",
listener = tweetCallback
}
Button ID settings
function buttonPressed(event)
local id = event.target.id
if id == "menu" then transition.to(homebtn, {time=50, y=display.contentCenterY + 124, onComplete=gameReady})
elseif id == "tweet" then transition.to(twitterbtn, {time=50, y=display.contentCenterY + 124, onComplete=tweetCallback})
elseif id == "reload" then transition.to(reloadButton, {time=50, y=display.contentCenterY + 124, onComplete=reloadGame})
end
return true
end
homebtn.id = "menu"
twitterbtn.id = "tweet"
facebookButton.id = "reload"
homebtn:addEventListener("tap", buttonPressed)
twitterbtn:addEventListener("tap", buttonPressed)
reloadButton:addEventListener( "tap", buttonPressed )