Bagikan melalui


StoreServicesEngagementManager.UnregisterNotificationChannelAsync Method

Definition

Explicitly invalidates the channel that is being used for notifications so the app no longer receives push notifications from any services, including targeted Partner Center push notifications and other notifications using Windows Push Notifications Services (WNS).

public:
 virtual IAsyncOperation<bool> ^ UnregisterNotificationChannelAsync() = UnregisterNotificationChannelAsync;
IAsyncOperation<bool> UnregisterNotificationChannelAsync();
public IAsyncOperation<bool> UnregisterNotificationChannelAsync();
function unregisterNotificationChannelAsync()
Public Function UnregisterNotificationChannelAsync () As IAsyncOperation(Of Boolean)

Returns

True if the unregister operation succeeded; otherwise, false.

Remarks

If you have called the RegisterNotificationChannelAsync method to register your app for Partner Center notifications, you can use the UnregisterNotificationChannelAsync method to stop receiving notifications and close the channel that was used for the notifications. After it has been closed, the channel can never be used again for any services, including targeted Partner Center push notifications and other notifications using WNS.

Channels that are closed through this method are no different than channels that have expired. To resume sending push notifications to this app, the app must request a new channel. Calling UnregisterNotificationChannelAsync on a channel invalidates the underlying URI as well as any non-expired, non-closed URIs previously created for the app.

Before you can use this method in your code, you must first install the Microsoft Store Services SDK and add a reference to the Microsoft Engagement Framework to your project. For more information, see Configure your app for targeted push notifications.

Applies to

See also