UPDATE- Following http://stackoverflow.com/questions/17881384/jquery-gets-loaded-only-on-page-refresh-in-rails-4-application,
add this to your Gemfile: gem 'jquery-turbolinks' and this to your assets/javascripts/application.js file: //= require jquery.turbolinks Now, things work "almost" fine locally. When I click the Invite Facebook friends" link in iPhone simulator, I get the correct response. I test it out, and it works as it should- that is, it sends the request to a Facebook friend. Then I upload to Heroku, but I still get the same problem. While testing, I noticed that if I use the refresh button on IOS Simulator, sometimes I get a blank page. I can navigate backward and get to other pages, but when I return to the page that was blank, it remains blank. I have to completely terminate my session (sign off) and sign in again to see the page again. I can't explain this, but perhaps these two issues are related. These things NEVER happen on the PC, either running locally or through Heroku. On Monday, November 18, 2013 10:32:40 AM UTC-8, Ephraim Feig wrote: > > I am pretty much following the method of > http://www.youtube.com/watch?v=OSRRYeRSES4 to invite Facebook friends to > my rails app. It works perfectly on my PC and it works on mobile when the > app is run inside Facebook. But when I run the app natively (iPhone or > Android), it opens the Facebook window but the friends list does not show > up. It was working fine on iPhone until a few days ago, and suddenly it > stopped working. The code is below. Any help will be greatly appreciated. > > <div id="friends"><p> <%= link_to "Invite your Facebook friends", "#", :id > => "invite_fb_friends" %> </p> > <div id="fb-root"></div> > <script src="http://connect.facebook.net/en_US/all.js"></script> > > <% if !Rails.env.development? %> > <script> > $(function() { > $("a#invite_fb_friends").click(function() { > FB.init ({ > appId: '222840481199747', > cookie:true, > statue: true, > oauth: true > > }); > FB.ui({method: 'apprequests', message:'Hey! We need beta > testers for this new app. No spam, ' + > 'a bit of thinking before posting, and fun with > friends.' }); > }); > }); > </script> > <% else %> > <script> > $(function() { > $("a#invite_fb_friends").click(function() { > FB.init ({ > appId: '545802082165826', > cookie:false, > statue: true, > oauth: true > > }); > FB.ui({method: 'apprequests', message:'Hey! We need beta > testers for this new app. No spam, ' + > 'a bit of thinking before posting, and fun with > friends.' }); > }); > }); > </script> > <% end %></div> > > > -- -- SD Ruby mailing list [email protected] http://groups.google.com/group/sdruby --- You received this message because you are subscribed to the Google Groups "SD Ruby" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/groups/opt_out.
