Check if facetime is enabled on the device

2019-06-23 16:10发布

问题:

The app we're building has a simple button that starts a facetime session with a specific number. No biggee here.

I use

[[UIApplication sharedApplication] canOpenURL: [NSURL URLWithString: @"facetime://5555555555"]];

to check if the device is capable of facetime calls. Again, this works fine.

But a user can turn facetime on/off through the settings screen of his device. When facetime is turned off the above canOpenURL method still returns YES even though facetime is disabled. And when I start a new session through the openURL method the screen simply goes to my contactlist without starting a facetime session.

Anyone know if it's possible to determine if facetime is enabled on the device.

回答1:

Unfortunately, there is no way that you can detect if FaceTime has been enabled or disabled (as of iOS 5.1). Sorry.

As for...

facetime://5555555555

...according to this Apple Developer forum post, Apple rejects apps that uses undocumented APIs, and FaceTime is one of them. Look at the fourth post.

This is the link that the person was talking about.

There is probably another way around it, but I can't think of anything right now. Hopes this helps answer your question.