0

I start a FaceTime call from my app using:

[[UIApplication sharedApplication] openURL:[NSURL URLWithString:[@"facetime://" stringByAppendingString:appleID]]]

Is there a way to know if FaceTime is already in use or the URL is already open when i call this method?

Or is it possible to know when i come back into my app after opening the URL?

Davide Bracaglia
  • 159
  • 1
  • 1
  • 12
  • What does `canOpenURL:` return? – thelaws Jun 22 '15 at 20:20
  • Hi, canOpenURL: returns true even when FaceTime is already in use. My wish is to check if I am already calling with FaceTime. I guess that canOpenURL: check only if FaceTime is available in the device. – Davide Bracaglia Jun 23 '15 at 14:56

1 Answers1

0

So, what I did to know if FaceTime was already in use/busy on another call is to check if other audio is playing on my device, taking the idea from this other question: 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");
}

I guess this does not ensure that it is FaceTime playing audio outside my app but it works fine for the goal i had to achieve.

Community
  • 1
  • 1
Davide Bracaglia
  • 159
  • 1
  • 1
  • 12