3

After I updated Facebook iOS SDK from 3.2 to 3.5 I'm getting this error when running my app in a device with iOS older than 5 (eg 4.3.5).

dyld: Symbol not found: _OBJC_CLASS_$_NSJSONSerialization
...
Expected in: /System/Library/Frameworks/Foundation.framework/Foundation

I can avoid this crash if I set Foundation framework as Optional, but I don't think this is the best option.

Is there another way to make Facebook SDK works in devices with iOS previous to version 5?

2 Answers2

2

From Facebook iOS SDK changelog v3.5: http://developers.facebook.com/ios/change-log-3.x/

Removes support for iOS 4.* Facebook 6.0 dropped support for iOS 4.x. To stay in sync, the Facebook SDK is also does not support iOS 4.x.

So, if you update to Facebook SDK 3.5 you lose support for iOS 4.x

0

That class was not available until ios5 - look at the class reference in the Xcode documentation window. What you need to do is grab JSONKit, an open source class, and use it. Usage is mostly the same. You will need to build this class into your app then test dynamically if the apple class exists, then use the appropriate class, or just always use the open source class.

Note that JSONKit is not ARCified, so you need to set the appropriate compile flag for it if the rest of your app is ARC.

Edit: so you may be able to get clever and write your own stub that bridges calls to JSONKit in older releases. Conceptually you should be able to make this work, but my fear would be that if the FB code was developed for ios5 then there may be other Api problems lurking in the code too - and you old spend a lot of time continually trying to find and fix them.

David H
  • 40,852
  • 12
  • 92
  • 138
  • Thank you David. I know that class is only available since iOS 5. The point is that is Facebook SDK who is using it, not my app directly. – Alberto Gonzalez May 10 '13 at 12:21