问题
I have referred How can I place a WhatsApp call from an iOS app? which states that this feature is currently not available in iOS and as per WhatsApp FAQ Share Extension (Custom URL Scheme) it has still not mentioned any schema for placing a call, document it has mentioned:
Placing a WhatsApp call(voice call VOIP)
To make a WhatsApp call, simply open the chat with the person you want to call and tap Call in the top right corner.
Whatsapp FAQ Here
But placing a WhatsApp call from android is possible, Which I could not find in iOS.But placing WhatsApp call feature is available from phone contacts.
So my doubt is whether it is currently available in iOS to place a WhatsApp (voip)voice call from my iOS app?
If possible can you please suggest me with url schema(if available) for this just like place a chat from my app like this @"whatsapp://send?text=Hello%2C%20World!" as I couldn't find this?
回答1:
I have google it and searched a lot on stackoverflow and https://faq.whatsapp.com
Seems like currently, video call from contact book feature is limited to OS level only.
But you can open particular contact then user has to manually tap on video call button.
This is regardless of phone no is stored in contact book or not. ( You can directly open )
I have tried this in Swift 3 code.
if #available(iOS 10.0, *) {
UIApplication.shared.open(NSURL(string: "whatsapp://send?phone=+91phonenumber")! as URL)
} else {
UIApplication.shared.openURL(NSURL(string: "whatsapp://send?phone=+91phonenumber")! as URL)
}
https://faq.whatsapp.com/en/iphone/23559013
Hope this helps you to figure out further way
来源:https://stackoverflow.com/questions/46784353/url-scheme-for-making-whatsapp-call-programmatically-from-ios-app-voice-call-vo