start migration onto 9.2.0

This commit is contained in:
InsanusMokrassar 2023-09-23 01:51:04 +06:00
parent 35e0cb4a46
commit d97c2a0562
2 changed files with 33 additions and 1 deletions

View File

@ -110,6 +110,32 @@ fun main() {
appendText("Alert") appendText("Alert")
} ?: window.alert("Unable to load body") } ?: window.alert("Unable to load body")
document.body ?.appendElement("p", {})
document.body ?.appendElement("button") {
addEventListener("click", { webApp.requestWriteAccess() })
appendText("Request write access without callback")
} ?: window.alert("Unable to load body")
document.body ?.appendElement("button") {
addEventListener("click", { webApp.requestWriteAccess { document.body ?.log("Write access request result: $it") } })
appendText("Request write access with callback")
} ?: window.alert("Unable to load body")
document.body ?.appendElement("p", {})
document.body ?.appendElement("button") {
addEventListener("click", { webApp.requestContact() })
appendText("Request contact without callback")
} ?: window.alert("Unable to load body")
document.body ?.appendElement("button") {
addEventListener("click", { webApp.requestContact { document.body ?.log("Contact request result: $it") } })
appendText("Request contact with callback")
} ?: window.alert("Unable to load body")
document.body ?.appendElement("p", {})
document.body ?.appendElement("button") { document.body ?.appendElement("button") {
addEventListener("click", { addEventListener("click", {
webApp.showConfirm( webApp.showConfirm(
@ -171,6 +197,12 @@ fun main() {
onSettingsButtonClicked { onSettingsButtonClicked {
document.body ?.log("Settings button clicked") document.body ?.log("Settings button clicked")
} }
onWriteAccessRequested {
document.body ?.log("Write access request result: $it")
}
onContactRequested {
document.body ?.log("Contact request result: $it")
}
} }
webApp.ready() webApp.ready()
}.onFailure { }.onFailure {

View File

@ -5,7 +5,7 @@ org.gradle.jvmargs=-Xmx2g
kotlin_version=1.8.22 kotlin_version=1.8.22
telegram_bot_api_version=9.1.2 telegram_bot_api_version=9.2.0
micro_utils_version=0.19.9 micro_utils_version=0.19.9
serialization_version=1.5.1 serialization_version=1.5.1
ktor_version=2.3.3 ktor_version=2.3.3