I am developing a chatbot for messenger platform using nodejs deployed on heroku. I am trying to get the user id in the webview. I have set the messenger extension field to true, whitelisted my domain, using latest updated version android app and also since now webview support the web browser, I am also viewing it in safari browser.
The messenger sdk is loading perfectly. I the check whether browser is supported or not which I get as result->true. Still I am facing problem getting the user id. My code is:
<script>
(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.com/en_US/messenger.Extensions.js";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'Messenger'));
window.extAsyncInit = function () {
var isSupported = MessengerExtensions.isInExtension();
alert(isSupported);
// the Messenger Extensions JS SDK is done loading
MessengerExtensions.getUserID(function success(uids) {
var psid = uids.psid;
alert(psid);
}, function error(err) {
alert("Messenger Extension Error: " + err);
});
};
</script>
NOTE: I have searched the solution for this problem but none of them work, hence I am post this error.