Click here to Skip to main content
15,891,513 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Iam developing a web application using mvc. In my application iam using facebook graph api to share something to facebook. I had done it with javascript. My code is


JavaScript
var fbResponse;
    var code = $("#c_Test").val();
    if (code) {
        url = url + "/" + code;
    }
    FB.init({
        appId: appId,
        xfbml: true,
        version: 'v2.0'
    });
    FB.login(function (response) {
        if (response.authResponse) {
            console.log(response);
            var fbResponse = response.authResponse;
            FB.ui(
              {
                  app_id: appId,
                  method: 'send',
                  link: url
              },
              function (response) {
                  if (response) {
                  } else {
                  }
              }
            );
            FB.api('/me', function (response) {
                $("#c_Name").val(response.name);
            });
        } else {
        }



Its works perfects in desktop web browsers. While using my application in iphone iam getting an error like
API Error Code: 4202 API Error Description: This dialog can not be displayed on this device Error Message: This method is not supported for this display type.


Iam taking response from login, after login iam calling send methos. Its working in desktop browsers. The issue with only iphone.
How can we solve this api error ? please help me

What I have tried:

I have tried many ways.

JavaScript
var fbResponse;
    var code = $("#c_Test").val();
    if (code) {
        url = url + "/" + code;
    }
    FB.init({
        appId: appId,
        xfbml: true,
        version: 'v2.0'
    });
    FB.login(function (response) {
        if (response.authResponse) {
            console.log(response);
            var fbResponse = response.authResponse;
            FB.ui(
              {
                  app_id: appId,
                  method: 'send',
                  link: url
              },
              function (response) {
                  if (response) {
                  } else {
                  }
              }
            );
            FB.api('/me', function (response) {
                $("#c_Name").val(response.name);
            });
        } else {
        }
Posted
Comments
[no name] 6-Oct-16 9:06am    
The error message seems perfectly clear to me. If you want it fixed, go ask Farcebook to change their API allow that dialog to be displayed on iPhones.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900