Skip to content

Instantly share code, notes, and snippets.

@fengyuanyang
Last active December 13, 2015 22:19
Show Gist options
  • Save fengyuanyang/4983780 to your computer and use it in GitHub Desktop.
Save fengyuanyang/4983780 to your computer and use it in GitHub Desktop.
local function tweetCallback( event ) -- 完成twitter動作後呼叫
if ( event.action == "cancelled" ) then -- 使用者取消
print( "User cancelled" )
else
print( "Thanks for the tweet!" ) -- 使用者分享
end
end
local options = {
message = "Hello Twitter world!", -- 預設分享文字
listener = tweetCallback, -- 設定listener
url = { "http://coronalabs.com", "http://apple.com" }, --網址類(URL)必須要打在這
image = {
baseDir = system.ResourceDirectory, --要分享的圖片所在資料夾
filename = "Icon.png" --圖片檔名
}
}
native.showPopup( "twitter", options ) -- 只要使用shopPopup,就能使用iOS內建的twitter系統
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment