0

I've transposed an existing XCode project to Rubymotion but I keep running into an issue with Facebook-iOS-SDK integration.

In my Rakefile:

$:.unshift("/Library/RubyMotion/lib")

require 'motion/project'
require 'motion-cocoapods'

require File.join(File.dirname(__FILE__), 'version')

Motion::Project::App.setup do |app|
  app.name = "My App"  
  app.pods do
    dependency 'Facebook-iOS-SDK', '~> 1.2'
  end
end

In my app delegate, I have a property defined for the Facebook object:

def facebook
  @facebook ||= Facebook.alloc.initWithAppId(FACEBOOK_APP_ID, andDelegate:self)
end

While I can call the facebook.authorize() without any problem, when I ask if the Facebook session is valid:

appDelegate = UIApplication.sharedApplication.delegate
if appDelegate.facebook.sessionValid?
  # do something here...
end

I get this exception:

(main)> Objective-C stub for message `isSessionValid' type `c@:' not precompiled. Make sure you properly link with the framework or library that defines this message.

Has anybody come across this before? Any suggestions on how I can fix this?

bodacious
  • 6,608
  • 9
  • 45
  • 74

1 Answers1

1

Which version of RubyMotion are you using? I think the latest version (1.23) fixes this. Try running sudo motion update

loddy1234
  • 31
  • 5