Simple posts to Facebook and Twitter iOS 5 & 6 - iphone

I'm currently implementing a simple button that posts to social networking sites (giving my app a little exposure, you know the drill). However, I'm a little confused by all this social networking stuff. On one hand I know iOS 6 has a really nice framework for FB and Twitter (Social.framework) but for iOS 5 it's a little different. iOS 6, I think I've got figured... I find it a little weirder when we go into iOS 5 however. From what I understand Twitter was already integrated into iOS 5 and can be accessed using the Twitter.framework and Account.framework frameworks. What I don't get is in order to support both 5 & 6 for Twitter do I have to use Social.framework, Twitter.framework and Account.framework to support everything? I.e. two different methods depending on iOS version. Or, if I use the latest SDK will iOS 5 twitter work with Social.framework? That Twitter covered.
Now for Facebook, how do I go about posting in iOS 5? I'm pretty sure Social.framework won't work in iOS 5, even if I build the app with latest SDK. Therefore I think it's inevitable that I'll have to have two different methods which run depending on the iOS version installed. Is that correct? If so, how do I go about integrating FB into iOS 5? Do I have to use the SDKs provided by Facebook?
So to summarise my questions if all that was a little wordy.
1) Can I incorporate Twitter-posting into my app using only Social.framework for both iOS 5 & 6, or do I have to do one method using Social.framework (for iOS 6) and then another method using Twitter.framework and Account.framework (iOS 5)?
2) I can use Social.framework for Facebook in iOS 6, but can't for iOS 5, therefore, I have to do two separate methods, one with Social.framework (iOS 6) and then one with the FB SDK (iOS 5), correct?
Thanks in advance, Regards,
Mike

1) Social.Framework is available only on iOS6+ so you have to split between the two frameworks (or you can use only Twitter.Framework even though some methods have been deprecated on iOS6)
2) You can use the Facebook SDK both on iOS5 and iOS6 (latest version for iOS at the time i write this answer is 3.5). The Facebook SDK already takes care of using the user's Facebook account on iOS6 or relying on the Facebook app on iOS5 or iOS6 when the account is not already configured in the phone

Related

Major iOS 5 features that cannot be used in iOS 4

Update - Example
The UIScrollView property in UIWebView is available for iOS 5 or later. I find this out by searching Apple's developer site for all of my UI element class one by one.
Things like this, is there a full collection for iOS 5 features?
Original Post
Such as which method of UIView is only available in iOS 5 or later.
I can't find out the problem why my app can't run on iOS 4.3 device but runs on iOS 5 or later.
Thank you!
If there are many new features iOS 5, how can I find it all in one place instead of reading Apple's website page by page?
Finally, I found it. Apple made a good summary.

Facebook SDK 3.5 in iOS 5 needs Social.framework

Quick question. I'm getting to grips with the FB SDK 3.5 and I was following this tutorial on the Facebook site: https://developers.facebook.com/docs/getting-started/facebook-sdk-for-ios/
The problem is, it says the SDK needs Social.framework. As far as I'm aware, that's not available on iOS 5. Obviously I can set some frameworks to optional but I don't know if that will stop me from posting status updates on iOS 5. Any ideas?
Regards,
Mike
It's fine to use the SDK in iOS5, the social.framework is used for the built-in Facebook account function in iOS6, on iOS5, the SDK will skip it.
It's okay to use the Facebook SDK, it needs you to add the Social.framework to your project, but this isn't available in iOS 5, not to worry the Facebook SDK will only use it if it's available (for the iOS built in Facebook integration).
But you do need to include it... so you should mark the Social.framework as "optional" in the Target's Build phases. This means it won't force it when you compile. Which can make you run into problems for iOS 5 which doesn't have Social.framework available.

AdSupport framework not added in ios5 with xcode 4.2

Im integrating FacebookSDK in my app with ios6 and Xcode4.5 .But when I run the app in prevoius versions of XCode (Xcode 4.2 with ios5) I couldn't be able to link Social.Framework and AdSupport.Framework .They are missing and I couldn't find it under Build Phases.Gone through Google and found they are not present in ios5.But when I make those Frameworks as optional .I have made them as optional.But that doesnot work for me .And I couldnot find any turnaround solution to this.
How can I get it worked in xcode4.2
iOS started supporting Facebook API which is Social.Framework is included in iOS 6. It's not available in earlier version for Facebook. You won't get a framework for iOS facebook api in XCode 4.2.
EDIT :
In this case what you have to do is, keep the framework optional which you have already done. Check if Facebook class exists before you call the function. If it does that means user is using iOS 6 or greater version then iOS 6. If it doesn't means user is using iOS version less then iOS 6. To give the reverse compatibility you'll have to implement the Facebook API.

How to support iOS5 and ios6 maps in same app?

What I should do to support both maps in my app ,I mean that iphone with iOS 5 will see google maps and iOS 6 device will see the new maps
I'll be glad to get a link to a tutorial
The choice of the map to load is made by the iOS itself.
You have simply to take care of not using methods added on iOS 6 when you are on iOS 5 (checking if the target responds to selector or using macros to have different code)
The new map support all methods of previous map system. If your project supports iOS 5, you'll see Google Maps when the app is executed on iOS5, and Apple Maps when is executed on iOS6.
A good approach imho, if you are new to iOS programming, is to develop for the iOS 5 target and test on iOS 5 simulator and device. Then, when you move to iOS 6, all should work correctly but on the Apple Maps automagically :-)
google have released their own version of Google maps as an SDK
https://developers.google.com/maps/mobile-apps
https://developers.google.com/maps/documentation/ios/

Sharing and iOS versions in xcode

I am making an application that outputs text and would like to give the users the option to share this text on twitter and/or Facebook..... I know that iOS6 is linked with twitter and Facebook. but what would happen if an user that has iOS 5.1 for example installs that application? I guess I am trying to see if I should use ios6 and the built in sharing features or ios5 and use sharekit to share on twitter and facebook.
My other question that is also related.
If I build my application in xcode with ios6 will users with ios5 installed still be able to install this application? what would then happen to the features that are only in ios6 like sharing?
Thanks for all your help
If you set your application's target to iOS 6, users operating on previous iOS versions will not be able to install it. Also, if you set the target to iOS 5 for example, you will not have the facebook native facebook integration available. So, in my opinion, you should set the target for iOS 5, set the facebook framework as optional and when launching the application, check what iOS version it's running on. If it is not iOS 6, use shareKit.