I’m using SocialFramework to post pictures and status updates on twitter within my app. the problem is app created using iOS SDK 6 crashes on iOS 5.1 devices because socialframework is missing.
the question: what’d be better: to hope everybody upgraded to iOS 6 or to re-implement Twitter feature without socialframework?
I’m using SocialFramework to post pictures and status updates on twitter within my app.
Share
Read the SDK Compatibility Guide in Apple documentation.
It explains how to make your application compatible with older iOS versions (like iOS5.1) while still being able to make users of newer iOS versions (like iOS6) have newest features (like the SocialFramework only compatible with iOS6).
The global principle being to test if the SocialFramework classes are available at runtime, and if they are (so the user is on iOS6 or above) use them, and if not, make whatever you want (for example display an
UIAlertViewto incitate the user to upgrade its iOS version to 6.0 or greater).See the SDK Compatibility Guide mentioned above for more details and code examples on how to do this and manage all the cases.
Also note that back in iOS5, the
Twitter Frameworkwas available before theSocial Frameworkwas released in iOS6 (which now replace and extends it, making the Twitter Framework obsolete in iOS6 but still usable in iOS5).So you can use the practices described in the above SDK Compatibility Guide to detect if
SocialFrameworkclasses are available, if so use them, and if not detect if theTwitterFrameworkclasses are available, to use this framework in iOS5 when available. And still fallback to anUIAlertViewto encourage an update when neither framework are available (for iOS4 users for example). Again, such cases are described in the aforementioned documentation.