admin管理员组文章数量:1391990
Creating the Webapp game as telegram mini app. And stucked with one feature based on the requestWriteAccess.
What i want to achieve is that when i requestWriteAccess from user, it will show pop up as the screen below
I tried this but it shows only the standart telegram bot alert bot as you can see it below
Here is the code we use
const allowsWriteToPm = window.Telegram.WebApp.initDataUnsafe.user.allows_write_to_pm;
if (!allowsWriteToPm) {
window.Telegram.WebApp.requestWriteAccess(function(ctx) {
console.log("[TG] requestWriteAccess: " + ctx);
if (!ctx || ctx !== "allowed" && String(ctx) !== "true"){
return;
}
TG.trySendGreetMsg();
});
} else {
TG.trySendGreetMsg();
}
I checked another products and it seems that they have almost the same code.
本文标签: javascriptTelegram requestWriteAccess popup windowStack Overflow
版权声明:本文标题:javascript - Telegram requestWriteAccess popup window - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744708695a2620995.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论