Detecting whether or not device support phone calls?
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.
How to tell if Cocoa Touch device can make calls?
You could query [[UIDevice currentDevice] model]
, and check if it is an iPhone.
How do I test if IOS device has telephone capabilities?
Check if application can open tel url:
if ([[UIApplication sharedApplication] canOpenURL:[NSURL URLWithString:@"tel:+11111"]])
// device has phone capabilities
iOS How to check if currently on phone call
The CTCallCenter
object has a currentCalls
property which is an NSSet
of the current calls. If there is a call then the currentCalls
property should be != nil.
If you want to know if any of the calls is actually connected, then you'll have to iterate through the current calls and check the callState
to determine if it is CTCallStateConnected
or not.
Related Topics
Ipad: Drag a Uitableviewcell from One Uitableviewcontroller and Drop It into Another
How to Add a Footer to a Uitableview in Storyboard
Don't Launch Simulator When Running Unittests
In Swift: Difference Between Array VS Nsarray VS [Anyobject]
How to Add a Toolbar to the Bottom of a Uitableviewcontroller in Storyboards
Align Button Image to Right Edge of Uibutton
iOS Get Heart Rate from Apple Watch in Near Real Time
Space Between Sections in Uitableview
Compare Two Version Strings in Swift
Ios5 What Does "Discarding Message for Event 0 Because of Too Many Unprocessed Messages" Mean
How to Implement "Share Button" in Swift
Uitextview Link Tap Recognition Is Delayed
How to Filter Nsarray Using Predicate on an Object Property
Error When Import Zlib in iOS: Symbol(S) Not Found Collect2: Ld
Getting Autocomplete to Work in Swift