ios - Detecting whether or not device support phone calls? -


is below code reliable used determine whether device can support phone calls or not? concern if apple changes iphone string else let's decide have "iphone 3g", "iphone 4" etc.

[[uidevice currentdevice].model isequaltostring:@"iphone"] 

the iphone supports tel:// uri scheme. use:

[[uiapplication sharedapplication] canopenurl:[nsurl urlwithstring:@"tel://"]]; 

canopenurl: explicitly checks whether there's application capable of opening url scheme, not url correct. doesn't matter no phone number specified. method returns bool, check yes or no.

that should literally answer whether there's application present capable of making telephone call. should okay against future changes in device segmentation.


Comments

Popular posts from this blog

linux - Mailx and Gmail nss config dir -

c# - Is it possible to remove an existing registration from Autofac container builder? -

php - Mysql PK and FK char(36) vs int(10) -