Windows.ApplicationModel.CommunicationBlocking Namespace
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Enables applications to support blocking calls and messages.
Classes
CommunicationBlockingAccessManager |
The manager responsible for keeping track of blocked numbers and displaying the appropriate blocking user interfaces. |
CommunicationBlockingAppManager |
Determines the application to use as a blocking application. |
Remarks
This API can be used by messaging and phone call applications in order to block incoming calls and messages. This API also enables you to pull up the app responsible for handling communication blocking. The following diagram shows how different applications interact with the communication blocking API.
![Communication blocking API dependencies](windows.applicationmodel.communicationblocking/images/communicationblockingapi.png?view=winrt-20348)
A user can install multiple applications that are capable of filtering messages and calls. However, only one of these blocking applications can be active at a time. Use CommunicationBlockingAppManager to determine whether or not your application is the currently active blocking app. You can also use CommunicationBlockingAppManager to pull up a user interface so the user can select the currently active blocking app. When an application is selected to be the active call blocking app, it will be notified by CommunicationBlockingAppSetAsActiveTrigger.
All functions that show interfaces are modeled as app-to-app calls.
You need to register for the following triggers in your application if you want it to be shown in the list of blocking applications.
- CommunicationBlockingAppSetAsActiveTrigger
- PhoneTrigger with a TriggerType of CallBlocked.
- ChatMessageNotificationTrigger
- ChatMessageReceivedNotificationTrigger
In order to use this API, you will need to define a new category in your application manifest file.
<Extension Category="windows.CommunicationBlockingProvider" />
In order to access blocked messages, you need to define a new capability in your application manifest file.
<Capabilities>
<DeviceCapability Name="blockedChatMessage" />
</Capabilities>
For a sample of how to implement this in your app, see Communication blocking and filtering.