Answered by:
Can't update secondary tile

Question
-
Hello everyone,
I'm creating an app that allows the user to add secondary tiles. I want to update those tiles with some data but every time I do a
Notifications.TileUpdateManager.createTileUpdateForSecondaryTile("id").update(tileNotification);
I get the following:
"JavaScript runtime error: The application identifier provided is invalid. WinRT information: The application identifier is invalid."
If I use this instead:
Notifications.TileUpdateManager.createTileUpdaterForApplication().update(tileNotification);
The main tile is updated with no problem (both tiles are wide tiles).
The id I'm using to identify the tile is the correct one (I've hardcoded it and I've also done a WIndows.UI.StartScreen.SecondaryTile.findAllAsync() just in case the id was different for some weird reason).
If I don't use any identifier then the exception is: Object doesn't support this action.
Am I doing something wrong? Is this a bug in the API? I've already tried to refresh and restart the device just in case but the result is still the same :(
Thanks!
Wednesday, September 28, 2011 12:12 AM
Answers
-
Before pinning your secondary tile, make sure to include dynamicTileCapable in the TileDisplayAttributes. If you don't set this, you'll receive the runtime error mentioned above.
For a full list of supported TileDisplayAttributes, please refer to http://msdn.microsoft.com/en-us/library/windows/apps/windows.ui.startscreen.tiledisplayattributes(v=vs.85).aspx
I hope this helps!
Daniel
- Proposed as answer by Jeff SandersMicrosoft employee, Moderator Thursday, September 29, 2011 6:33 PM
- Marked as answer by Anton Molleda Thursday, September 29, 2011 7:47 PM
Wednesday, September 28, 2011 10:02 PM
All replies
-
Hi Anton,
You cannot use this to update a secondary tile:
http://msdn.microsoft.com/en-us/library/windows/apps/br208574(v=vs.85).aspx
Note that the PRAID is the app id not the tile id (see article):
Parameters
- applicationId
-
Type: System.String [.NET] | String^ [C++]
The Package Relative Application ID (PRAID) of the tile.
Return value
Type: TileUpdater
The object you will use to send changes to the tile identified by applicationId.
Remarks
This method isn't used very often because it's only useful for apps that belong to a multi-app package.
The app identified by applicationId must belong to the same package as the caller.
Jeff Sanders (MSFT)- Proposed as answer by Jeff SandersMicrosoft employee, Moderator Wednesday, September 28, 2011 3:06 PM
Wednesday, September 28, 2011 3:06 PMModerator -
Hello Jeff,
I think I didn't explain myself clearly before :(
I am using createTileUpdateForSecondaryTile which should be supported:
The other references are other tests I've done without success so please ignore them.
My question then is: should I use createTileUpdateForSecondaryTile to update a secondary tile from JavaScript using the tileId? If so, why do I get the AppIdentifier error?
Thanks!
Wednesday, September 28, 2011 3:39 PM -
Before pinning your secondary tile, make sure to include dynamicTileCapable in the TileDisplayAttributes. If you don't set this, you'll receive the runtime error mentioned above.
For a full list of supported TileDisplayAttributes, please refer to http://msdn.microsoft.com/en-us/library/windows/apps/windows.ui.startscreen.tiledisplayattributes(v=vs.85).aspx
I hope this helps!
Daniel
- Proposed as answer by Jeff SandersMicrosoft employee, Moderator Thursday, September 29, 2011 6:33 PM
- Marked as answer by Anton Molleda Thursday, September 29, 2011 7:47 PM
Wednesday, September 28, 2011 10:02 PM -
It worked!
Thank you very much :)
Thursday, September 29, 2011 7:46 PM -
The attribute can be set either to showname or dynamictilecapable. How do get both? I want to show the name as well as badge notification.
Thursday, November 17, 2011 8:48 AM -
You should be able to 'or' the values together you want: ShowName | DynamicTileCapable
or ShowName + DynamicTileCapable
Jeff Sanders (MSFT)- Proposed as answer by Jeff SandersMicrosoft employee, Moderator Wednesday, November 30, 2011 3:00 PM
Wednesday, November 30, 2011 3:00 PMModerator