How to detect if the phone app is available for va

2019-03-16 23:16发布

I'd like to show or hide a button that lets a user make a phone call based on whether or not the user can actually make a call (iPhone or iPod touch). Is it possible to somehow detect if the phone app is available to the user in cocoa-touch? Or am i constrained to detecting the device type to make that distinction? I would rather check for functionality than static clients in case something changes down the line for whatever reason (not that iPod touch users could ever make non-voip phone calls anyways, but the code would be cleaner).

1条回答
姐就是有狂的资本
2楼-- · 2019-03-17 00:00
BOOL canMakePhoneCalls = [[UIApplication sharedApplication]
                           canOpenURL:[NSURL URLWithString:@"tel:5555555"]];
查看更多
登录 后发表回答