get phone call states in iOS 10

前端 未结 5 1954
梦谈多话
梦谈多话 2020-12-30 15:29

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 altern

5条回答
  •  死守一世寂寞
    2020-12-30 16:15

    To be notified about phone call states, starting from iOS 10, you should use CXCallObserver class and implement its CXCallObserverDelegate protocol method, that is suggested in this answer:

    - (void)callObserver:(CXCallObserver *)callObserver callChanged:(CXCall *)call {
        if (call.hasConnected) {
            // perform necessary actions
        }
    }
    

提交回复
热议问题