EDIT - Closer. Need to have a port number for my callback url.
Problem is that port is dynamic and constantly changing. Has anyone ran into this before?
Working with rhomobile. Need some help to better understanding how facebook oauth2 works.
when user launches app for the first time want to do facebook connect to get user info and post to wall when user comments.
Assume I can do the following:
Have a button which calls an Action in my Controller. -> Action launches WebView to FB mobile for authentication -> User enters credentials on FB -> on redirect_uri_controller gets auth_code and I do a AsyncHttp.get requesting token with another redirect_url -> lands redirect_url & auth_token stored.
Right now, have a button that calls the below controller
def fb_initiate_connect
call_back_url = url_for(:controller => "Settings", :action => :fb_initiate_connect_callback)
url = "http://www.facebook.com/dialog/oauth?client_id=#{fb_app_id}&redirect_uri=#{call_back_url}&scope=email,read_stream,publish_stream&display=touch"
WebView.navigate(url)
end
This launches a UIWebview in my app, goes to FB mobile site but getting "An error occurred with APP_NAME. Please Try again later."
Think its because cookie is not being set/found? Everything in here is pretty much manual so would have to do something like WebView.execute_js("document.cookie=WHAT?;")
But do I put this in my call_back_url or fb_initiate_connect?