使用 Abid 打开 WhatsApp 对话不起作用

Open WhatsApp conversation using Abid doesn't work

我正在尝试为特定联系人打开 whatsapp conversation/chat。 它不会打开所需的聊天,而只会打开应用程序。 不知道怎么了:

 let URLString  = "whatsapp://send?abid=\(ID);text=lOL;"
        UIApplication.sharedApplication().openURL(NSURL(string: URLString)!)

URLString 值:whatsapp://send?abid=414;text=lOL

有什么建议吗?

尝试此操作并检查 UIApplication 并打开 URL。

let whatsAppURL: NSURL = NSURL(string: "whatsapp://send?abid=\(ID)&text=lOL")
if UIApplication.sharedApplication().canOpenURL(whatsAppURL){
    UIApplication.sharedApplication().openURL(whatsAppURL)
}

像这样更新您的 URL

whatsapp://send?abid=\(ID)&text=lOL

来源自HERE