Я уже проверил несколько других вопросов по этому вопросу и установил LSApplicationQueriesScheme
для WhatsApp, но моему приложению все еще не разрешено делиться с WhatsApp.
Вот скриншот моего Info.plist
файл:
![Here's a screenshot of my Info.plist file.](https://i.stack.imgur.com/Oz2aj.png)
Это мой общий доступ к коду WhatsApp.Я хотел бы за некоторую помощь.Я уже проверил другие вопросы переполнения стека, и они не помогли.
@IBAction func shareWhattsappButtonTapped(_ sender: UIButton) {
let shareMessage = "Hola! Estoy buscando a mi \(posts!.petType) que es de raza \(posts!.breed). La ultima vez que lo vimos fue en \(posts?.address). Ayudenme a encontrarlo porfavor! Subi la foto con toda la información a Gastet. Pueden verlo aquí: https://itunes.apple.com/mx/app/gastet/id1407059324?l=en&mt=8"
shareWhatssapp(message: shareMessage)
}
func shareWhatssapp(message: String) {
let msg = message
let urlWhats = "whatsapp://send?text=\(msg)"
if let urlString = urlWhats.addingPercentEncoding(withAllowedCharacters: .urlQueryAllowed) {
if let whatsappURL = NSURL(string: urlString) {
if UIApplication.shared.canOpenURL(whatsappURL as URL ) {
UIApplication.shared.open(whatsappURL as URL)
}
}
}
}