Action="Clear" in windows phone push notification

316 views Asked by At

I don't understand well the goal of Action="Clear" when sending XML to WP notification server.

Example :

<?xml version="1.0" encoding="utf-8"?>
<wp:Notification xmlns:wp="WPNotification" Version="2.0">
  <wp:Tile Id="[Tile ID]" Template="IconicTile">
    <wp:SmallIconImage [Action="Clear"]>[small Tile size URI]</wp:SmallIconImage>
    <wp:IconImage Action="Clear">[medium/wide Tile size URI]</wp:IconImage>
    <wp:WideContent1 Action="Clear">[1st row of content]</wp:WideContent1>
    <wp:WideContent2 Action="Clear">[2nd row of content]</wp:WideContent2>
    <wp:WideContent3 Action="Clear">[3rd row of content]</wp:WideContent3>
    <wp:Count Action="Clear">[count]</wp:Count>
    <wp:Title Action="Clear">[title]</wp:Title>
    <wp:BackgroundColor Action="Clear">[hex ARGB format color]</wp:BackgroundColor>
  </wp:Tile>
</wp:Notification>

I want to push devices tile once a day with a simple title and a image, so should I put Action="Clear" on each property ?

What if don't put it ?

1

There are 1 answers

0
Kevin Gosse On BEST ANSWER

You don't need to use Action="Clear" unless, as its name indicates, you need to clear the value of a property.

Basically, when you omit a value from your notification, it keeps the old value. For instance, if you decide to remove the count from the tile and send:

<wp:Count></wp:Count>

Then it won't actually remove the count but keep the old value. It's convenient because it means you only have to send with your notification the values you want to update. And when what you want is really to clear the property, and not keep the previous value, you just have to add the Action="Clear" part:

<wp:Count Action="Clear"></wp:Count>