Why Facebook is not showing share dialog inside tab

Today I struggled for a few hours with non-working FB.ui share dialog on facebook tab (so no authorization or whatsoever was required). The strange thing was that the script worked great in dev environment and refused to work in production.

Today I struggled for a few hours with non-working FB.ui share dialog on facebook tab (so no authorization or whatsoever was required). The strange thing was that the script worked great in dev environment and refused to work in production.

Code was quite standard:

The first problem was that app did not show async dialog at all – without any errors. After changing dialog type to display: 'popup' I finally found a problem (with solution provided here: http://stackoverflow.com/questions/8153187/facebook-api-error-100-error-message-redirect-uri-url-is-not-properly-formatted) – in production environment my app was using underscores in domain name… After changing domain name into one that does not contain underscores, the app started to work like a charm. Even with async dialog type. I hope this will help someone.

The code was quite standard:

First problem was that app did not show async dialog at all – without any errors. After changing dialog type to display: 'popup' I finally found a problem (with solution provided here: http://stackoverflow.com/questions/8153187/facebook-api-error-100-error-message-redirect-uri-url-is-not-properly-formatted) – in production environment my app was using underscores in domain name… After changing domain name into one that does not contain underscores, the app started to work like a charm. Even with async dialog type. I hope this will help someone.

(credits: photo from unsplash.com)