Search code examples
iosfacebook-ios-sdkrubymotion

Trouble installing Facebook-iOS-SDK 3.1.1 in Rubymotion


I'm trying to install the Facebook-iOS-SDK to my RubyMotion project but have hit a few hurdles.

According to section 5 of the Getting Started Instructions I should include the FacebookSDK framework and SQLite3.

I know how to do these in XCode but have no idea when it comes to Rubymotion - can anyone advise?


Solution

  • I would recommend including it using CocoaPods via the motion-cocoapods gem.

    Add motion-cocoapods to your Rakefile:

    require 'motion-cocoapods'
    

    In your app setup, add this:

    app.pods do
      dependency 'Facebook-iOS-SDK'
    end
    

    Also include the sqlite library thusly:

    app.libs += ['/usr/lib/libz.dylib', '/usr/lib/libsqlite3.dylib']
    

    Add this right below your frameworks:

    app.weak_frameworks += %w{ AdSupport Accounts Social }
    

    Do a rake clean and then build again and you should have it installed. Oh, and probably gem install motion-cocoapods or drop it into your Gemfile if you're using bundler.