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?
(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.
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/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With