[Workaround] FB.ui share dialog: “The domain of this URL isn't included in the app's domain”

I try to implement the share dialog with the Facebook javascript sdk in a PWA. When I open the dialog I get an error that the domain of this URL isn’t included in the app’s domain.

I tried to add all domains and all sub-domains in my Facebook developers console, in the “Facebook login - valid OAuth” but maybe since I try to use the share dialog these domains should be added elsewhere?

Note: My app implement a Facebook login and I could confirm that I don’t face any problems with this flow, the domains are correct for the login and the login works fine.

Code:

 FB.ui({
    app_id: 'XXXXXXXXXXX',
    method: 'share',
    href: 'https://something.com'
 }, (response: any) => {
    console.log(response);
    });

55

P.S.: Same question on Stackoverflow https://stackoverflow.com/questions/50187233/fb-ui-share-dialog-the-domain-of-this-url-isnt-included-in-the-apps-domain

i have the same issue… how did you solve this… please explain.

I didn’t solve it yet

thanks for reply bro. how you are sharing in app?

Like described above

Fck it, never found a solution so I went with the ‘send’ option instead of ‘share’

            FB.ui({
                method: 'send',
                link: 'https://something.com',
                app_id: XXXXXXXXXXX'
            }, (response: any) => {
                console.log(response);
            });