首页 > 解决方案 > Facebook SDK change display type in the FB.login()

问题描述

I'm working on the Facebook Login integration into my website and I've done everything which was necessary to achieve this and described in the Facebook documentation

So I'm using FB.login() method

export function facebookLogin() {
    return new Promise((res: any, rej: any) => {
        // TODO: maybe it might be moved to some dedicated API file? But we don't want to use it anywhere else
        FB.login((response: FacebookLoginCallbackResponse) => {

            if (response.authResponse) {
                res(response.authResponse);
            } else {
                rej();
            }

        }, {scope: "public_profile, email"});
    });
}

It works fine but when the popup is opened (and it's really big. I would like to make it smaller) the warning shows at the bottom of window.

You are using a display type of 'page' in a small browser window or popup. For a better user experience, show this dialog with our JavaScript SDK without specifying an explicit display type. The SDK will choose the best display type for each environment

The question is: How to change it? There is no option TYPE in the Login Dialog parameters. I didn't found anything about this possibility in the Login Dialog documentation. Can someone give me some tip, please?

标签: javascriptfacebook

解决方案


推荐阅读