Find if user is in a call or not?

后端 未结 3 576
一向
一向 2020-12-21 01:58

I wanted to see if a user was using the application and to see if they were in a phone call or not. I was following this link to see check if a user was in a phone call or n

3条回答
  •  半阙折子戏
    2020-12-21 02:31

    Or, shorter (swift 5.1):

    private var isOnPhoneCall: Bool {
        return CXCallObserver().calls.contains { $0.hasEnded == false }
    }
    

提交回复
热议问题