So, it is a bug on facebook, one that they are aware of, and one that they are not going to fix any time soon ( shortage in developer talent? "strategy"? I'll ask Mark... ). Hearing this dissappointing news, I then tried the url in chrome a few different ways, and big surprise: it works fine when you request the desktop site on the confirm screen.
So, there is one way left to us mobile devs, and that is to make a dialog that jails a webview with
- a desktop-seeming user-agent
- a URL override to stop the fb website from redirecting through Intent.ACTION_VIEW
here's my implementation (in a fragment):
private void sendRequestDialog( ) {
String requestUri = "https://www.facebook.com/dialog/friends/?id="+
Id+"&app_id="+getString(R.string.fb_app_id)+
"&redirect_uri=http://www.facebook.com";
WebView webView = new WebView(this.getActivity());
webView.getSettings().setUserAgentString(getString("Mozilla/5.0 (X11; Linux x86_64; rv:10.0) Gecko/20100101 Firefox/10.0"));
webView.setWebViewClient(new WebViewClient(){
public boolean shouldOverrideUrlLoading(WebView view, String url){
return false;
}
});
webView.loadUrl(requestUri);
AlertDialog.Builder dialog = new AlertDialog.Builder(this.getActivity());
dialog.setView(webView);
dialog.setPositiveButton("Done", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
dialog.dismiss();
}
});
dialog.show();
Of course, you'll want to make those strings references, but this works and looks good in the UI.
Onwards! -AnB