Firebase动态链接在WhatsApp中共享时不显示图像

时间:2019-08-30 07:45:59

标签: ios swift whatsapp firebase-dynamic-links

我正在共享我的应用程序中的firebase动态链接,该链接包含图像,描述和URL。当我直接在TwitterFacebookMessenger上共享或与UIActivityViewController共享时,它将显示图像,描述,URL。但是,当我在Whatsapp上共享相同的链接时,它将仅显示url,描述而不显示图像。

fileprivate func shareLinkOnWhatsapp(url : URL){
    let urString = url.absoluteString
    let urlStringEncoded = urString.addingPercentEncoding(withAllowedCharacters: NSCharacterSet.urlQueryAllowed)
    let url  = URL(string: "whatsapp://send?text=\(urlStringEncoded!)")

    if UIApplication.shared.canOpenURL(url!) {
        UIApplication.shared.open(url!, options: [:]) { (success) in
            if success {
                print("WhatsApp accessed successfully")
            } else {
                print("Error accessing WhatsApp")
            }
        }
    }
}

0 个答案:

没有答案