Facebook sharing API

I have a responsive system, where I created a webview for android and ios with this system to use it as an application. Until then ok. So Facebook Facebook Share button implemented as per Facebook documentation ( https://developers.facebook.com/docs/sharing/web ). I did the implementation by Javascript code.

Implemented for the web because the app is all on the web. In the app this is only the webview.

It even works, both on the desktop, and on applicative. However, after I do the sharing the app gets the screen all white, it does not return to the url of my site.

I believe that this happens because when I do the sharing on the desktop, it opens a facebook pop-up for me to do the sharing, and after I do the sharing this pop-up closes by itself.

So I think this white screen in the app is due to this pop-up having closed.

I think it would solve if I pass to Facebook API a redirect url after sharing, so I share and then get redirected to some url.

But researching about this I didn't find anything in the Facebook documentation or the internet.

Could anyone help me with any solution?

Thank you now!

================================

Follow button code for sharing on Facebook:

<!-- FACEBOOK -->
<div align="center" class="col-xs-8 col-md-8">
    <div align="center" class="fb-share-button" data-href="https://www.site.com<?php echo $_SERVER['PHP_SELF']; ?>" data-layout="button" data-size="small" data-mobile-iframe="false">
        <a target="_blank" href="https://www.facebook.com/sharer/sharer.php?u=https%3A%2F%2Fdevelopers.facebook.com%2Fdocs%2Fplugins%2F&amp;src=sdkpreparse" class="fb-xfbml-parse-ignore"></a>
    </div>
</div>
<!-- /FACEBOOK -->

And the Facebook Javascript SDK:

$(document).ready(function() {
    window.fbAsyncInit = function() {
        FB.init({
        appId            : 'APP_ID',
        autoLogAppEvents : true,
        xfbml            : true,
        version          : 'v2.12'
        });
    };

    (function(d, s, id){
        var js, fjs = d.getElementsByTagName(s)[0];
        if (d.getElementById(id)) {return;}
        js = d.createElement(s); js.id = id;
        js.src = "https://connect.facebook.net/en_US/sdk.js";
        fjs.parentNode.insertBefore(js, fjs);
    }(document, 'script', 'facebook-jssdk'));
});
Author: Comunidade, 2018-03-21