Closed starchildno1 closed 11 years ago
As far as the picture goes, I just make a static call to FB.api get the picture's url of the facebook user and append it to FB.Me Session in the afterFacebookLogin
Although I can now access the users profile pic after ajax calls, that still does not help the Facebook Helper methods that depend on Facebook-init()
public function afterFacebookLogin(){ App::uses('FB', 'Facebook.Lib'); $Me = FB::api('/me'); $FBpicture = FB::api('/me/?fields=picture'); $picture['picture'] = $FBpicture['picture']['data']['url']; $this->Session->write('FB.Me', array_merge($Me, $picture)); }
Well it's not the Helper, It's just ignorance. We use FB.XFBML.parse(); to re-render the helpers when using Ajax.
If any of the Facebook->helpers that requires init(), are in elements updated by ajax then those helpers would break. I tried using the picture helper in a comments app but after an ajax update the picture helper is gone. It also happens on elements that contained like and share as well. Normally in my View-js directory I would normally just call mySpecialScript.setup() and the script would be reinitialized. But i tried this-Js-Object(this-Facebook->init()). The thing is it only loads partially- div id="fb-root" with only script async="" src="http://connect.facebook.net/en_US/all.js" included.
Is there a way to reinitialize Facebook-init() after ajax calls?