Vinicius Gualberto
Vinicius Gualberto

Reputation: 639

There is a way to send custom data in push notification in Windows Phone?

I know that are Raw Notifications on WNS but the whole content of the notification is showed in the notification. I wanted to do like APNS and GCM does. A custom properties in the json payload that it's delivered to the app but its not showed to the user. There is a way to do that in WNS?

Upvotes: 3

Views: 926

Answers (1)

marcinax
marcinax

Reputation: 1195

You can send parameters in launch attribute, it can be similar to url. For example, for toast notifications:

<toast launch="?param1=sample&param2=sample2">
</toast>

and parse it in the application. Value from launch attribute can be retrieved in OnLaunched handler. HERE is an article about handling activation from a toast notification (from MSDN).

Note: you can put into launch any other format you want. I suggested uri-based parameter because it is easy to parse using WwwFormUrlDecoder, which is mentioned HERE.

Upvotes: 3

Related Questions