Reputation: 1142
I am trying to make a call through the telpromt command to return to my application after it makes a call:
NSString *telno = @"telprompt://121,,,,14";
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:telno]];
Is there any way to calculate call duration in all situations from my app?
Upvotes: 2
Views: 1633
Reputation: 69469
Save a NSDate
when your app is receiving the applicationWillResignActive
, this will be the start of the call. Then in the applicationDidBecomeActive
calculate the difference between the saved NSDate
and current date. This will give you an rough estimate of the time the call lasted.
Closer than this you will never be able to come.
Upvotes: 2