I want to get phone call states in my app.
After some search I found CoreTelephony
framework. But that is deprecated in iOS 10. SO is there any other alternative available?
I also found CallKit
. A new framework in iOS 10. But didn't getting call states from same as I searched.
相关问题
- Core Data lightweight migration crashes after App
- How can I implement password recovery in an iPhone
- State preservation and restoration strategies with
- “Zero out” sensitive String data in Swift
- Get the NSRange for the visible text after scroll
相关文章
- 现在使用swift开发ios应用好还是swift?
- UITableView dragging distance with UIRefreshContro
- TCC __TCCAccessRequest_block_invoke
- Where does a host app handle NSExtensionContext#co
- Swift - hide pickerView after value selected
- How can I add media attachments to my push notific
- How do you detect key up / key down events from a
- didBeginContact:(SKPhysicsContact *)contact not in
There is some delegate method available that indicate incoming and outgoing call status.
See : https://developer.apple.com/reference/callkit
import CallKit
into yourAppDelegate
and add the following code:To be notified about phone call states, starting from iOS 10, you should use
CXCallObserver
class and implement itsCXCallObserverDelegate
protocol method, that is suggested in this answer:You can try this code:
Create the instance of call observer
Initiate the instance and set the delegate
Add the call observer delegate
In Swift 4.2:
Apple does not allow you to access these informations though you can do so by using third party libraries but your app would be rejected at the time of submittion to App Store because apple does not allow to gain access to sensitive user information .