Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iOS Development: How can I shorten a URL from my code?

I'm building an iPhone app and I'd like to include functionality that allows users to login to twitter and tweet a link to my app. In order to do this, however, the tweet will need to shorten the URL to my app on the App Store. How can I write code to shorten a URL for a tweet?

I've done a search for this and found a tutorial on iCodeBlog, as well as some questions posted on SO, however, they're all either more work than I think is needed or they're using http://api.tr.im, which is no longer available. I'm hoping there's a newer approach to this that is as simple as the iCodeBlog solution.

Thanks for your wisdom!

like image 988
BeachRunnerFred Avatar asked Jan 21 '11 22:01

BeachRunnerFred


1 Answers

I just google a few minutes because I'm also interested in that topic. And I found this: TinyURL API I think that's the easiest way to implement something like this. I think I'll write a little class for this to use it in further projects. :-D

like image 173
Sandro Meier Avatar answered Nov 16 '22 01:11

Sandro Meier