Is the below code reliable to be used to determine whether a device can support phone calls or not? My concern is if apple changes the iphone string to anything else let's say they decide to have "iphone 3g", "iphone 4" etc.
[[UIDevice currentDevice].model isEqualToString:@"iPhone"]
You can make phone calls from the Phone app and other apps or widgets that show your contacts. Wherever you see a phone number, you can usually tap it to dial. You may be able to tap underlined phone numbers in Google Chrome to copy the number to the dialpad.
Calls on Other Devices allows other linked devices to relay calls via the iPhone to the phone network. The iPhone must be nearby, turned on, and connected to Wi-Fi, as do the other devices placing calls via the iPhone.
The iPhone supports the tel:// URI scheme. So you could use:
[[UIApplication sharedApplication] canOpenURL:[NSURL URLWithString:@"tel://"]];
canOpenURL: explicitly checks whether there's an application capable of opening that URL scheme, not that the URL is correct. So it doesn't matter that no phone number is specified. The method returns a BOOL, so check that for YES or NO.
That should literally answer whether there's any application present capable of making a telephone call. So it should be okay against any future changes in device segmentation.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With