I am using the following code to make a phone call in my Swift iOS app:
if let phoneNumber = URL(string: "tel://8001968001") { UIApplication.shared.open(phoneNumber) }
I want to know if I need to provide a contact usage description in the Info.plist file for this functionality. I know that a usage description is required for accessing the user’s contacts or address book, but in this case, I am only initiating a phone call using the // URL scheme.
I have already provided the necessary NSAppTransportSecurity settings in the Info.plist file to allow arbitrary loads for the URL scheme. However, I am unsure if a contact usage description is still required. Can someone clarify whether a contact usage description is necessary in this scenario?
Any help or insights would be greatly appreciated. Thank you!
if let phoneNumber = URL(string: "tel://8001968001") { UIApplication.shared.open(phoneNumber) }
2
Answers
you do not need to provide a contact usage description in the Info.plist file. The contact usage description is only required when your app attempts to access the user’s contacts or address book.
Apple documentation explicitly stating that a contact usage description is not required for the
URL scheme.
you can also use this fuction for calling phone number