facebook - Login repeats after authenticate, if i try to send a friends request -
im trying build 'cheer action' app. game in iphone, want post 'welcome message' in users wall (i need 'public_stream' permission) , invite friends visit webpage.
here question.. authenticate user using:
_url = "http://www.facebook.com/dialog/oauth/?client_id=" + app_id + "&redirect_uri=" + app_net_folder + auth_response_uri + "&state=" + session_id; i response in uri, , access_token, user_id, etc. post message in wall in way:
_url = "https://www.facebook.com/dialog/apprequests?app_id=" + app_id; _url += "&message=" + string_tourl(string_tohtml(request_msg)); now want invite friends (using multi friend list dialog). it, can use javascript fb.ui. in way:
fb.init({appid : app_id, logging : false, frictionlessrequests: true, oauth : true}); fb.ui({method: 'apprequests', message: msg, title: title}, requestcallback); when it, window opened asking me again user's login.. user has been authenthicated. dont know how fb in javascript user has been alredy authenthicated! (i have access_token, don't know how use in javascript functions).
someone knows doing wrong? or how 2 actions asking 1 time user's login?
thanks!!
if log in, can login user id using below code
var userid = fb.facebook.apiclient.get_session().uid; if(userid > 0 || userid != '') { alert('user log in'); } hope it's helpful you
Comments
Post a Comment