How do I detect if the Facebook Send Dialog is available?

463 views Asked by At

The send dialog is a useful piece of functionality. Sadly it is not available on mobile devices

I call the api in the following way;

app.sendMessage = function(){
  FB.ui({
    app_id: app.facebook_app_id,
    method: "send",
    link:   "http://google.com"
  });
};

Right now the outcome on a mobile device is a nasty error page.

Is there a way to detect in javascript whether or not the send dialog is available?

I'd suggest something like;

function sendDialogAvailable(){
  return FB.supports("senddialog");
}

I could then change my app's functionality according to this property, but right now I fear I'll have to resort to browser sniffing.

0

There are 0 answers