0
我一直在嘗試新的Messenger Webview,它以URL的彈出形式打開,而不是在新選項卡中打開。新的Facebook Messenger Webview不能正常工作
,我寫了一個小腳本來獲取用戶的ID按本documentation
然而,在移動應用程序,我能夠獲得用戶ID。但在網站上開放(包括facebook.com/messages和messenger.com)它爲我的錯誤:
This SDK method is not supported on this Messenger client. Please upgrade.
<body>
<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() {
alert('loaded sdk');
};
function getUser() {
MessengerExtensions.getUserID(function success(uids) {
var psid = uids.psid;
alert(JSON.stringify(psid));
}, function error(err, errorMessage) {
alert(JSON.stringify(errorMessage));
});
}
</script>
<input type="button" onclick="getUser()" value="Get user id" />
</body>
好的。讓我試試 –
有沒有辦法讓它在新標籤中打開URL?現在它只有在彈出窗口內纔有效。 –
是的,只能在popup,afaik中工作。 – amuramoto