gpt4 book ai didi

html - Whatsapp URL Scheme 向电话号码发送消息

转载 作者:行者123 更新时间:2023-11-28 04:17:56 24 4
gpt4 key购买 nike

是否可以向未存储在通讯录中的特定 whatsapp 帐户(phonenumer)发送 whatsapp 消息?

想在我的网站上设置一个 whatsapp url scheme 以通过 whatsapp 提供直接联系。

最佳答案

这是可能的!尝试使用 swift 3 和 xcode 8.3.2。

    let date = Date()
let msg = "Hi my dear friends\(date)"
let urlWhats = "whatsapp://send?phone=phoneNumber&abid=phoneNumber&text=hi"
if let urlString = urlWhats.addingPercentEncoding(withAllowedCharacters: NSCharacterSet.urlQueryAllowed) {
if let whatsappURL = NSURL(string: urlString) {
if UIApplication.shared.canOpenURL(whatsappURL as URL) {
UIApplication.shared.openURL(whatsappURL as URL)
} else {
print("please install watsapp")
}
}
}

关于html - Whatsapp URL Scheme 向电话号码发送消息,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35254021/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com