iOS5 Twitter integration

Hi,

I asked this in the forums here - https://developer.anscamobile.com/forum/2012/01/20/ios5-twitter-integration

I’m not sure if this is possible now but if not I would like to be able to use the new ios5 native twitter integration so that it’s a more seamless experience to post to twitter.

Thanks,
Scott. [import]uid: 51622 topic_id: 20726 reply_id: 320726[/import]

I’ve deleted your other thread just to avoid dupes but can respond here.

Firstly, we are aware better Twitter integration is something people want so I will count this as a +1.

In the meantime this code works;
[lua]-- Function for URLencoding of message content
local function escape (s)
s = string.gsub(s, “([&=+%c])”, function ©
return string.format("%%%02X", string.byte©)
end)
s = string.gsub(s, " ", “+”)
return s
end

local tweetText = “This is the tweet message.”

local postBody = escape( tweetText )
local theNetwork = theNetwork or “twitter” – twitter is default

–local theString = string.gsub(message, “( )”, “%%20”)
if theNetwork == theNetwork or “twitter” then
native.showWebPopup(20, 20, display.contentWidth - 40, display.contentHeight - 90, “http://twitter.com/intent/tweet?text=”…postBody)
end[/lua]

I know it isn’t exactly what you want but soon we will hopefully be able to remedy that.

Peach :slight_smile: [import]uid: 52491 topic_id: 20726 reply_id: 81450[/import]

Thank you for replying Peach,

I’ve implemented what you have suggested for now but appreciate that it can be improved.

Cheers,
Scott. [import]uid: 51622 topic_id: 20726 reply_id: 81485[/import]

This is great!
But after I launch the webpopup, and tweet, how do I know it has finished and kill off the popup?
[import]uid: 108660 topic_id: 20726 reply_id: 81537[/import]

Got it.
Put the webpopup on a page with a close button, and kill the popup in the button code [import]uid: 108660 topic_id: 20726 reply_id: 81552[/import]

For some reason the text in the username / pwd fields jumps up and down. Does anyone else get this behaviour?
[import]uid: 51622 topic_id: 20726 reply_id: 81558[/import]

Any news on this? I’m just finishing up my game and I’m in coding the social aspect now :slight_smile: [import]uid: 144908 topic_id: 20726 reply_id: 114258[/import]

Thanks for the code Peach :slight_smile: Adding it to my App

Larry [import]uid: 11860 topic_id: 20726 reply_id: 114410[/import]

Peach’s code is nice and simple - was using it until I realised that the sample Twitter app shows how to use oAuth for SSO, etc…

It’s a pretty complicated setup, but once you get an understanding it’s worth the effort IMO. [import]uid: 33275 topic_id: 20726 reply_id: 114432[/import]

@SegaBoy and @Peach
When signing up at Twitter for an AppID I see the information below.
Since you have done this before maybe you can help figure out what they really mean.
To me this means that if we are using OAuth 1.0a ( based on corona sample ) then whatever I put in the CallBack URL - my base website domain www.whatever.com really does not matter, because the corona API is going to handle this based on my AppID and other config details.
Correct?

Twitter Developer Sign up
Callback URL:
Where should we return after successfully authenticating? For @Anywhere applications, only the domain specified in the callback will be used. OAuth 1.0a applications should explicitly specify their oauth_callback URL on the request token step, regardless of the value given here. To restrict your application from using callbacks, leave this field blank.

Thanks
Larry
www.DoubleSlashDesign.com
[import]uid: 11860 topic_id: 20726 reply_id: 114549[/import]