views:

410

answers:

4

I want to publish a post to user's wall..for this first i am making user to log in and getting the session id also...but in order to publish i need the user to grant me publish_stream permission..so immmediately after i am obtaining auth_token by capturing url of the login success screen, i am making call to http://www.facebook.com/connect/prompt%5Fpermissions.php? with "api_key","ext_perm","display" as parameteres..but when the above url is redirected and displayed on BrowserField i am seeing "Incompatible web browser " instead of the permission granting dialog or popup..i will be greatful if anyone can help...thanx a lot

A: 

Making hand-constructed calls to facebook endpoints is tricky. Sometimes they need you to pass cookies that are in the facebook.com domain (impossible if you are an iframe web app), and they have other requirements like the one you hit, which I have also encountered.

The "incompatible web browser" error is because you are not passing a user-agent header that Facebook recognizes as a legitimate web browser that a real person might be using, as opposed to a bot or some other automated process.

Try passing a real web browser user agent, such as

Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0)

That should get you past this particular error

Pat James
A: 

Hi tek3 & Pat James,

i think the error message is bb browser originated since fb sends anything but not the mobile prompt page (my assumption) although i set the display=wap attribute.

Can you please confirm this? Did you manage to fix getting extended permissions for bb devices?

I'm testing here with Samsung Galaxy, N82 and BB Bold 9000. Having only trouble with bb bold. Thank you very much.

BTW: My calls to FB use php FacebookMobile. Prompt Permissions is however called via client (issueing header redirect).

Greetz Stefan

stefan
Hi Stefan,I am sorry buddy, i didnt find any workaround for this though it might be a possibility that anyone else might have implemented this.I think that BB Browser is incompatible with facebook site and also we have to implement cookie management as BrowserField doesnt provide cookie environment. You can try logging in m.facebook.com through BB Browser(outside your application) and select any application and see if extended permissions prompt comes up...I have heard that it doesn't..try this out and if possible lemme also know it..
tek3
A: 

I have the same problem. But before I see "Incompatible Browser" message I'm getting exception in console right after navigation to http://www.facebook.com/connect/prompt_permissions.php: "ThrownValue in ExecuteScript TypeError: Cannot convert 'null' to an object. Running at line 12: b.onclick=function(e){e=e||window.event;c=e.target||e.srcElement;var f=d(c,"A")||b,g=f.getAttribute("ajaxify")||f.href;if(g)user_action(f,"a",e);switch(f.rel){case "dialog":case "dialog-post":Bootloader.loadComponents("dialog",function(){Dialog.bootstrap(g,null,f.rel=="dialog");});break;case "async":case "async-post":Bootloader.loadComponents("async",function(){AsyncRequest.bootstrap(g,f);});break;default:return;}return false;};. Called from line 12: !function(){var a=document,b=a.documentElement,c=null,d=function(e,f){while(e&&e.nodeName!=f)e=e.parentNode;return e;};b.onclick=function(e){e=e||window.event;c=e.target||e.srcElement;var f=d(c,"A")||b,g=f.getAttribute("ajaxify")||f.href;if(g)user_action(f,"a",e);switch(f.rel){case "dialog":case "dialog-post":Bootloader.loadComponents("dialog",function(){Dialog.bootstrap(g,null,f.rel=="dialog");});break;case "async":case "async-post":Bootloader.loadComponents("async",function(){AsyncRequest.bootstrap(g,f);});break;default:return;}return false;};b.onsubmit=function(e){e=e||window.event;var f=e.target||e.srcElement;if(!f||f.nodeName!="FORM"||!f.getAttribute("ajaxify") )return;user_action(f,"f",e);Bootloader.loadComponents("dom-form",function(){bootstrap_form(f,c);});return false;};b.className=b.className.replace("no_js","");}();function eval_global(b){if("string"!=typeof(b) ){throw new Error("JS sent to eval_global is not a string. Only strings "+"are permitted.");}else if(""==b)return;var c=document.createElement("script");c.type="text/javascript";try{c.appendChild(document.createTextNode(b) );}catch(e){c.text=b;}var a=(document.getElementsByTagName("head")[0]||document.documentElement);a.appendChild(c);a.removeChild(c);}function hasArrayNature(a){if(!a||(typeof a!="object")||(!("length" in a) ) )return false;if(a instanceof Array||("callee" in a)||("push" in a&&"pop" in a) )return true;return false;}function copy_properties(b,c){b=b||{};c=c||{};for(var a in c)b[a]=c[a];if(c.hasOwnProperty&&c.hasOwnProperty("toString")&&(typeof c.toString!="undefined")&&(b.toString!==c.toString) )b.toString=c.toString;return b;}function arrayize(a){if(!hasArrayNature(a) )return[a];return a;}function is_empty(b){if(b instanceof Array){return b.length==0;}else if(b instanceof Object){for(var a in b)return false;return true;}else return!b;}.

Dmytro

related questions