问题
Can anyone suggest me is there a way to block all incoming calls for a while? or at least can I put my phone into silent pragmatically ? Please suggest
回答1:
No. Simply you cannot do that. There is no public API is available to do that. Your app will be in sandbox mode. You cannot access them in anyway.
回答2:
Now it can be done from iOS 10 and above using the CallKit framework upto a certain amount. The numbers we provide can be blocked. If you want to block all incoming calls, just use Airplane mode.
The CallKit framework provides programmatic access to VoIP functionality, as well as call blocking and identification.
来源:https://stackoverflow.com/questions/17946105/ios-how-to-block-all-incoming-calls