Detecting the call events in ios
Asked Answered
H

1

22

I am new to ios. I was wondering if there is any way to detect the call events like incoming call, outgoing call even if my app is not in foreground. And if yes it is possible then can i read the details about that call like duration, whether it is missed, dialed or recieved. Thanks in advance.

Haematogenesis answered 19/8, 2013 at 9:19 Comment(3)
Check out these links . #10055206 developer.apple.com/library/ios/documentation/…Aerostatic
This answer is no. Please refer: https://mcmap.net/q/588678/-ios-showing-an-alert-when-getting-a-callWalt
As iOS 8 is not out is any way to detect the call events like incoming call, outgoing call even if my app is not in foreground. Or any other new alternatives?Castalia
C
30

Yes you can detect a Call. but only if your app is running in the foreground. For this you can use the Core Telephony Framework.

If your app will fall in any of the background running categories (VOIP, AUDIO, Location tracking or accessory ) you might be able to use the CTCallCenter in the background. But be aware that Apple will reject you app if you miss use the background running mode for something it was not meant for.

The CTCallCenter will allow you to detect any calls that are started or already in progress.

However you will not be able to detect any detail about the call, the CTCall identifying the call will only tell you this state. The callID of CTCall will just give you an unique identifier for the call but not the number being called.

Cordiality answered 19/8, 2013 at 9:25 Comment(8)
thanks bro , but is there any way to get incoming call number or name in background state .... ?Antre
@Mohittomar No this is not possible and would be breach of privacy.Cordiality
So how are they working in this app itunes.apple.com/in/app/caller-id-ringtones-hear-who/…Antre
My guess would be that they create a custom sound, which they assign the contact as ringtone.Cordiality
if we can create a caller id app or can't fetch caller info , so how TrueCaller works ? please suggest.Antre
is same API can be used for detecting facetime calls as well?Mazonson
We are able to get the information about the incoming call if app is in running mode. But when app goes to background mode it is not working for us. Is it possible in iOS8 without breaking any rules from Apple?Trimetallic
Unfortunately, CTCallCenter appears to be completely broken in iOS 9 (built with Xcode 7+) with neither the currentCalls property nor the callEventHandler working at all.Morphology

© 2022 - 2024 — McMap. All rights reserved.