views:

1070

answers:

1

hi Guys, i am trying to build a facebook app using iframe(not fbml) i am using php client. after trying a lot i m not able to publish stream also i am not able to create a pop up to ask user for extended permission i have used following :

function facebook_prompt_permission(permission) { ensure_init(function() { //check is user already granted for this permission or not FB.Facebook.apiClient.users_hasAppPermission(permission, function(result) { // prompt offline permission if (result == 0) { alert(result); // render the permission dialog FB.Connect.showPermissionDialog(permission,function(result){ if (result == null) alert('no permissons granted'); else alert('permissions ' + result); },true,null); } else { // permission already granted. alert("permission already granted"); } }); }); }

facebook_prompt_permission('publish_stream');

the response for checking the permission comes as 0 but when i try "FB.Connect.showPermissionDialog" to show pop up to ask user for permission nothing happens no pop up.

i am struggling from 2 days so far can any one help me out.

Thanks in advance. Raj

+1  A: 

/* Need to check this user has the permissions to post to wall etc....*/ if (!$facebook->api_client->users_hasAppPermission("publish_stream")) { // Redirect for permissions $url = "http://www.facebook.com/connect/prompt_permissions.php?api_key=$apikey&v=1.0&ext_perm=publish_stream&next=[YOURAPPURL]"; header("Location: $url"); exit; }

Justin
thanks justin the permissions were there what i was missing was when i initialize the FB object i was not giving complete URL of my "xd_receiver.htm" I was giving relative path, once i provided the complete path like "http://myserver/xd_receiver.htm" it worked very fine.
Rajinder Deol

related questions