FB.ui send dialog box not working on iPhone

msantos picture msantos · Sep 2, 2013 · Viewed 7.9k times · Source

i'm having troubles at creating a FB.ui send dialog box when my web app is running on iPhone. Here's the code snippet, in javascript:

    if(navigator.userAgent.match(/iPad/i) || navigator.userAgent.match(/iPhone/i)){
        window.top.location = "http://m.facebook.com/dialog/send?app_id=<<My_App_Id>>&link=<<The_Link>>&redirect_uri=<<The_Url>>&to=<<User_Id>>";
    } else{
        FB.ui({method: 'send',
            link: "<<The_Link>>",
            picture: picture,
            description: description,
            to: User_Id
        });
    }

It works nice when i use any browser on windows, works nice using Safari on iPad too. But when i try to open a dialog box to send a message on iPhone, i see the following error messsages:

This dialog is not available on this device. API Error Code: 4202 API Error Description: This dialog cannot be displayed on this device Error Message: This method isn't supported for this display type

I've already had this error messages when I called FB.ui({}) method on iPad and, therefore, I created that if statement for treating this situation on iPad. But this workaround didn't work for iPhone.

Somebody can help me?

Answer

zurg picture zurg · Nov 5, 2013

This dialog can be used with the JavaScript SDK and by performing a full redirect to a URL. It is not supported on mobile devices. https://developers.facebook.com/docs/reference/dialogs/send/