I have a responsive system, where I created a webview for android and ios with that system to use it as an application. Until then, okay. So I implemented a Facebook share button as Facebook documentation ( link ). I made the implementation by Javascript code.
Implemented for the web because the app is all over the web. In the app this is only the webview.
It even works, both on the desktop and in the application. However, after I do the sharing the app gets the whole screen white, it does not return to the url of my site.
I believe this happens because when I do the sharing on the desktop, it opens a popup of facebook for me to do the sharing, and after I do the sharing this popup closes alone.
So I think this white screen in the application is due to this pop-up being closed.
I think it would solve if I pass the Facebook API a redirect url after sharing, so I share and then I'm redirected to some url.
But researching this did not find anything in the Facebook documentation or the internet.
Could someone help me with some solution?
Thank you in advance!
===================================
Follow the 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&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'));
});