我从我的应用程序中使用以下命令启动FaceTime调用:
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:[@"facetime://" stringByAppendingString:appleID]]]当我调用这个方法时,有没有办法知道FaceTime是否已经在使用或者URL已经打开了?
或者,在打开URL后,是否可以知道何时返回我的应用程序?
发布于 2016-03-03 15:56:43
因此,为了知道FaceTime是否已经在另一个呼叫中使用/忙碌,我所做的就是检查我的设备上是否正在播放其他音频,这是从另一个问题Detecting active AVAudioSessions on iOS device中得到的想法。
// check if other audio is playing
BOOL isPlayingWithOthers = [[AVAudioSession sharedInstance] isOtherAudioPlaying];
if(isPlayingWithOthers){
NSLog(@"other audio is playing - FaceTime could be in use");
//do nothing
}else{
NSLog(@"no other audio is playing - FaceTime not in use");
}我猜这并不能确保在我的应用程序之外播放音频的是FaceTime,但它可以很好地实现我必须实现的目标。
https://stackoverflow.com/questions/30986669
复制相似问题