Titanium Community Questions & Answer Archive

We felt that 6+ years of knowledge should not die so this is the Titanium Community Questions & Answer Archive

Facebook crashing on first login

After a successful Facebook login (not using the proxy, but setting the secret), if I try to run anything requiring a session key (post status, execute), the app will crash with an error message about session key set to nil.

Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: ' -[NSCFDictionary setObject:forKey:]: attempt to insert nil value (key: session_key)'

When I relaunch the app, the API calls work fine. This happened in 0.9.3 and still in 1.0

Any ideas what would be going on here?

Thanks!

— asked March 16th 2010 by Blake Byrnes
  • facebook
0 Comments

3 Answers

  • Ok, I figured this out. If you try to call Ti.Facebook.setup(<api key>, <secret>) more than once, it will throw this error. I had two tabs that load facebook information, so had the setup call twice.

    If you make sure to only initialize Facebook one time (e.g., in app.js), you should be good.

    NOTE: this is only if you do not use a session proxy, and choose to put your secret code and api key inside your app.

    — answered March 21st 2010 by Blake Byrnes
    permalink
    0 Comments
  • Why would you want to include your api key AND your secret? This is very bad if you care about hackers manipulating your data.

    http://www.performantdesign.com/2009/09/03/facebook-iphone-session-proxy-in-php-fbsession-getsessionproxy/

    then just set sessionProxy to the url you set up that script at. Make sure to remove Facebook.setup so it will call the proxy instead.

    — answered May 17th 2010 by Ryan Gartin
    permalink
    0 Comments
  • Because I didn't have any server side hosting for the app, and didn't want to setup hosting just to have an FB proxy. Is it simple to decrypt an app and get at the source code? Or just theoretically someone could steal it?

    — answered May 17th 2010 by Blake Byrnes
    permalink
    0 Comments
The ownership of individual contributions to this community generated content is retained by the authors of their contributions.
All trademarks remain the property of the respective owner.