Facebook graph api adding custom tab not working

53 Views Asked by At

I'm trying to add custom tab using facebook graph api. I tried everything on the doc but nothing is working. Here's my sample code.

    $('#addTab').click(function(event){
    FB.ui({
        method: 'pagetab',
        redirect_uri: 'https://{mydomain}.com',
    }, function(response) {
        if((response && !response.error_code) || window.mobileAndTabletCheck()) {
            console.log(response);
            FB.api(
                '/{mypageid}/tabs',
                'POST',
                {"custom_name":"My Custom Tab","tab":"app_{myappid}",
                    "access_token":"{I put my access token here}"},
                function(response) {
                    // Insert your code here
                    //   
                }
            );
        } else {
            console.log('error');
        }
    });
});

But I'm getting this messages from the two method

FB.ui

FB.api

0

There are 0 best solutions below