Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

FB.ui send dialog box not working on iPhone

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?

like image 753
msantos Avatar asked Sep 02 '13 12:09

msantos


2 Answers

(Just repost this one as an answer)

In some cases, you might want to use this https://developers.facebook.com/docs/plugins/send-button as a temporary solution.

Unfortunately you can't change the interface of this button.

like image 33
Goon Nguyen Avatar answered Oct 27 '22 00:10

Goon Nguyen


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/

like image 160
zurg Avatar answered Oct 26 '22 23:10

zurg