Share via


PushNotificationManager.Register Method

Definition

Registers the app to receive PushReceived events when incoming notifications are received.

Note

The PushNotificationManager class has a dependency on the Singleton package. Because of that dependency, there are certain considerations to be aware of if you're calling these APIs from a self-contained app. For more info, and specifics, see Dependencies on additional MSIX packages.

public:
 virtual void Register() = Register;
void Register();
public void Register();
function register()
Public Sub Register ()

Remarks

For packaged apps, the COM server is defined in the app manifest. The process calling Register and the process defined in the manifest as the COM server are required to be the same. For unpackaged apps, the calling process will be registered as the COM server.

To ensure that the PushReceived event handler is called within the process of the running app, be sure to register the handler for that event before calling Register. Otherwise, a new process will be launched to handle the notification.

Before your app terminates, call Unregister or UnregisterAll.

Applies to