Stavash
Stavash

Reputation: 14304

Facebook iOS SDK & backwards compatibility

I'm trying to wrap my head around this and figure out what would be the best approach: I want to take advantage of all the new features that iOS 6.0 introduced in terms of interacting with facebook - this includes the built-in social framework that allows fast facebook SSO and native post dialogs. This is done fairly easily using the new Facebook iOS SDK v3.1.1.

The problem is that I also want my applications to be available for any non-iOS 6.0 adopters. This made me face a very ugly situation in which I need to create an elaborate social wrapper that would have to be compiled differently (with different FB SDKs) and to run separate code in order to support earlier iOS versions. Because a lot of the Facebook SDK already includes fallbacks and handles a lot of old, deprecated calls to the feed and dialog APIs, I figured that there must be a better way, while taking this in account, to create such a social wrapper.

I guess what I'm asking for here is any clue as to where to proceed from here. If anyone has ever tackled this issue (even in earlier versions of the SDK) I would be glad to know.

Thanks in advance

Upvotes: 2

Views: 429

Answers (1)

Guy Chen
Guy Chen

Reputation: 118

Weak linking is definitely the way to go here.

The 3.1.1 SDK can handle running on either iOS 5 or iOS 6, all you need to do is weak link the relevant frameworks in your build settings, and change the deployment traget to 5.0 (leaving the base sdk as 6.0).

Of course, you still need to handle the case when the native post dialog isn't available (You can use FBNAtiveDialogs' canPresentShareDialogWithSession: method) and use the SDK dialog instead.

Upvotes: 3

Related Questions