How to check if device can make a phone call (iOS 8)?

前端 未结 2 1909
感动是毒
感动是毒 2020-12-05 00:20

On iOS <8 you could use function - (BOOL)canOpenURL:(NSURL *)url.

On iOS 8 this function returns YES, even on iPad. I guess it\'s connec

2条回答
  •  抹茶落季
    2020-12-05 01:13

    You could just see if it's an iPhone. And possibly use this in conjunction with - (BOOL)canOpenURL:(NSURL *)url. That way you avoiding devices that obviously can't make a cellular phone call.

    if ([[[UIDevice currentDevice] model] isEqualToString:@"iPhone"] ) {
         // Make Phone Call
    }
    

提交回复
热议问题