Software and Technology Ramblings

May 19, 2010

Twitter Status Update URL issue with URL encoding

Filed under: iPhone Development — Doug Hays @ 2:43 pm

I am developing an iPhone app that allows the user to tweet information from the app. For simplicity’s sake, I chose to use the URL method of sending the user off to Twitter to sign in and finish their status update. When I redirected the user to:

http://mobile.twitter.com/home?status=Hello%20World

The status update was dropped after the user logged in. So, I switched to:

http://www.twitter.com/home?status=Hello%20World

which looked fine even on a smaller screen. And, after the user logged in, the status message was retained. But, so was the URL encoding. Instead of “Hello World” the status would have been an unsightly “Hello%20World”.

I finally stumbled onto the fix and it’s an easy one. Just drop the www:

http://twitter.com/home?status=Hello%20World

And, now it works as expected after the user logs in.

Powered by WordPress