Currently did ios5 twitter integration in my app using Sharekit framework but I came across some strane issues of random max. character length shown in twitter window.
Sometimes I can see max character length as 106, sometimes its 95 and sometimes is 87.Its weird.
I understand that if we add images then it take around 21 characters + if we add URL by ourself then it reduces 21 character more. so at the end character length available for me should be 140-21-21 = 98.
But its not. any solution why its showing varying max character length ?
The twitter framework in iOS 5 recognizes URL’s and knows they will be shortened to 20 chars. So an image and and url leaves you 140 – 21 – 20 = 99 chars. But if an URL is already shorter than 20 chars, it won’t be wrapped to 20 chars, so http://apple.com will be just 16 chars and the tweet will be (140 – 21 – 16 =) 103 chars!
Besides that, are you sure the variations are not caused by differences in iOS < 5 and iOS5?
Sharekit doesn’t know twitter is wrapping all URL’s longer than 20 chars so it will tell you the URL needs the full amount of chars: 140 – 21 – URL_LENGTH = a lot longer.