Windows Phone SDK
How to integrate Pushwoosh SDK into your Windows Phone project

SDK Integration

Integration guide for Windows Phone 8.1 and upper versions

If you target Windows Phone version 8.1, please use this guide for the integration.
You can use an emulator while working with push notifications.
1. Download our SDK package. If you develop for Windows Phone 8, add reference to PushSDK/WP8-MPNS/Release/PushSDK.dll to your project.
2. In the code add the PushSDK namespace: using PushSDK;
3. Initialize push service with the following code:
1
NotificationService service = NotificationService.GetCurrent("YOUR_PUSHWOOSH_APP_ID", "AUTH_SERVICE_NAME_OR_NULL", null);
2
service.OnPushTokenReceived += (sender, pushToken) => {
3
//code to handle push token
4
};
5
6
service.OnPushTokenFailed += (sender, error) => {
7
//code to handle push subscription failure
8
};
9
10
service.OnPushAccepted += (sender, pushNotification) => {
11
//code to handle push notification
12
};
13
14
service.SubscribeToPushService();
Copied!
    First parameter – identifier of your application in Pushwoosh (required);
    Second parameter – name of service for authenticated pushes: pass nullif you don’t have one set-up;
    Third parameter – list of the trusted servers that can send Tile notifications (required for receiving Tile notifications).
4. Make sure you have enabled ID_CAP_PUSH_NOTIFICATION and ID_CAP_IDENTITY_DEVICE in your project. Expand Properties folder in your Windows Phone application project and open WMAppManifiest.xml.
Enable ID_CAP_PUSH_NOTIFICATION and ID_CAP_IDENTITY_DEVICE capabilities by checking the corresponding checkbox.
1
<Capabilities>
2
<Capability Name="ID_CAP_IDENTITY_DEVICE" />
3
<Capability Name="ID_CAP_PUSH_NOTIFICATION" /> // Enable to allow push notifications for your application
4
<Capability Name="ID_CAP_WEBBROWSERCOMPONENT" />
5
</Capabilities>
Copied!
That’s it! Easy, isn’t it?
Last modified 2yr ago
Copy link