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

Supports Windows 8.1, Windows Phone 8.1, Windows 10

SDK Integration

You can use an emulator while working with push notifications.
To integrate Pushwoosh into your application, follow the steps below.
1. Download our SDK package.
2. Add reference to PushSDK/Project-Win8.1-WNS/PushSDK.winmd to your project Or PushSDK/Project-Win10-WNS/PushSDK.winmd if you develop for Windows 10
3. In the code add PushSDK namespace: using PushSDK;
4. Initialize push service with the following code:
1
NotificationService service = PushSDK.NotificationService.GetCurrent("YOUR_PUSHWOOSH_APP_ID");
2
service.OnPushAccepted += (sender, pushNotification) => {
3
//code to handle push notification
4
string pushString = pushNotification.ToString(); //will return json push payload
5
};
6
7
service.OnPushTokenReceived += (sender, pushToken) => {
8
//code to handle push token
9
};
10
11
service.OnPushTokenFailed += (sender, errorMessage) => {
12
//code to handle push subscription failure
13
};
14
15
service.SubscribeToPushService();
Copied!
5. In your App.xaml.cs in OnLaunched function add:
1
protected override void OnLaunched(LaunchActivatedEventArgs args)
2
{
3
NotificationService.HandleStartPush(args.Arguments);
4
5
//other code
6
}
Copied!

Important!

If you plan to use Toast notifications, make sure Toast notifications are switched on in your application project. Go to the Application UI tab in manifest settings, and set Toast Capable to Yes. Otherwise, Toast notifications will not work on the device.
Last modified 2yr ago
Copy link