SlideShare ist ein Scribd-Unternehmen logo
1 von 18
Oliver Scheer
Senior Technical Evangelist
Microsoft Deutschland
http://the-oliver.com
Push Notifications
Push
Notifications
3/18/2014
Push Notifications and Live Tiles
• Push Notifications offer developers a way to send timely
information relating to their applications even when they
are not running
+
• Windows phone has the unique ability to provide the end
user glanceable access to the information they care most
about, via Live Tiles
Push Notifications
Server-initiated communication
Enable key background scenarios
Preserve battery life and user experience
Prevent polling for updates
Three Kinds of Notifications
• Raw
• Notification message content is application-specific
• Delivered directly to app only if it is running
• Toast
• Specific XML schema
• Content delivered to app if it is running
• If app is not running, system displays Toast popup using notification message content
• Tile
• Specific XML schema
• Never delivered to app
• If the Tile is currently pinned to the Start screen, system updates it using notification message
content
5
Push Notification Data Flow
URI to the service:
"http://notify.live.com/throttledthirdparty/01.00/AAFRQHgiiMWNTYrRD
XAHQtz-AgrNpzcDAwAAAAQOMDAwMDAwMDAwMDAwMDA"
Push enabled
applications
Notifications
service
HTTP POST
the message
Push endpoint is established. URI is
created for the endpoint.
1
2
3
Third-party
service
MPNS:
Microsoft
hosted
server
Send PN
Message
4
Push Notification Features
• Tile updates can update any display element of each of the Tile templates
• Be careful to downgrade updates sent to 7.1 clients
• 30 subscription endpoints allowed per phone
• Maximum size of a notification is 1KB for the header and 3KB for the payload.
• Unauthenticated Web Service limited to 500 push notifications per subscription per day
• Authenticated Web Services are recommended
• Communication uses HTTPS channel
• No limit
• Able to register a callback request
Toast Message Content
•Used by system to display Toast message if app not running
•Navigates to page specified in <Param> (if supplied)
•If app is already running
• ShellToastNotificationReceived event fires
• <Text1> and <Text2> values in event args as Dictionary<string, string>
8
Toast Message Content
• Use the following HTTP headers:
• Where <batching interval> is 3 – Immediate delivery, 13 – delivered within 450 seconds, 23 –
delivered within 900 seconds
9
string toastMessage = "<?xml version="1.0" encoding="utf-8"?>" +
"<wp:Notification xmlns:wp="WPNotification">" +
"<wp:Toast>" +
"<wp:Text1>WEATHER ALERT</wp:Text1>" +
"<wp:Text2>Stormy</wp:Text2>" +
"<wp:Param>/page1.xaml?value1=1234<wp:Param>" +
"</wp:Toast>" +
"</wp:Notification>";
sendNotificationRequest.ContentType = "text/xml";
sendNotificationRequest.Headers.Add("X-WindowsPhone-Target", "toast");
sendNotificationRequest.Headers.Add("X-NotificationClass", "<batching interval>");
Tile Message Content
10
• Tile messages are never delivered to the app
• There are specific schemas for the a Tile update message for each of the three
Tile Templates: Flip, Cycle and Iconic
• Only Tiles using Flip and Iconic templates can be updated with images at remote URLs
• Remote Images limited to 80KB and must download in 30 seconds or less
• V7.x clients cannot consume these new templates. Recommend you:
• In your app, capture the device unique ID, the push URI, the OS version and the app
version. Send this data to your Web service registration method
• Make sure you only send the new templates to compatible new OS versions/app versions!
• Use the following HTTP headers:
sendNotificationRequest.ContentType = "text/xml";
sendNotificationRequest.Headers.Add("X-WindowsPhone-Target", “token");
sendNotificationRequest.Headers.Add("X-NotificationClass", "<batching interval>");
FlipTile Template Tile Message Schema
<?xml version="1.0"?>
<wp:Notification xmlns:wp="WPNotification" Version="2.0">
<wp:Tile Id="[TileId]" Template="FlipTile">
<wp:SmallBackgroundImage Action="Clear">[sm tile img URI]</wp:SmallBackgroundImage>
<wp:WideBackgroundImage Action="Clear">[front of wd tile img URI]</wp:WideBackgroundImage>
<wp:WideBackBackgroundImage Action="Clear">[back of wd tile img URI]</wp:WideBackBackgroundImage>
<wp:WideBackContent Action="Clear">[back of wd tile content text]</wp:WideBackContent>
<wp:BackgroundImage Action="Clear">[front of med tile img URI]</wp:BackgroundImage>
<wp:Count Action="Clear">[count]</wp:Count>
<wp:Title Action="Clear">[title text]</wp:Title>
<wp:BackBackgroundImage Action="Clear">[back of med tile img URI]</wp:BackBackgroundImage>
<wp:BackTitle Action="Clear">[back of tile title text]</wp:BackTitle>
<wp:BackContent Action="Clear">[back of med tile content text]</wp:BackContent>
</wp:Tile>
</wp:Notification>
3/18/201411
CycleTile Template Tile Message Schema
<?xml version="1.0"?>
<wp:Notification xmlns:wp="WPNotification" Version="2.0">
<wp:Tile Id="[TileId]" Template="CycleTile">
<wp:SmallBackgroundImage Action="Clear">[sm tile img URI]</wp:SmallBackgroundImage>
<wp:CycleImage1 Action="Clear">[photo 1 img URI]</wp:CycleImage1>
<wp:CycleImage2 Action="Clear">[photo 2 img URI]</wp:CycleImage2>
<wp:CycleImage3 Action="Clear">[photo 3 img URI]</wp:CycleImage3>
<wp:CycleImage4 Action="Clear">[photo 4 img URI]</wp:CycleImage4>
<wp:CycleImage5 Action="Clear">[photo 5 img URI]</wp:CycleImage5>
<wp:CycleImage6 Action="Clear">[photo 6 img URI]</wp:CycleImage6>
<wp:CycleImage7 Action="Clear">[photo 7 img URI]</wp:CycleImage7>
<wp:CycleImage8 Action="Clear">[photo 8 img URI]</wp:CycleImage8>
<wp:CycleImage9 Action="Clear">[photo 9 img URI]</wp:CycleImage9>
<wp:Count Action="Clear">[count]</wp:Count>
<wp:Title Action="Clear">[title text]</wp:Title>
</wp:Tile>
</wp:Notification>
3/18/201412
IconicTile Template Tile Message Schema
<?xml version="1.0"?>
<wp:Notification xmlns:wp="WPNotification" Version="2.0">
<wp:Tile Id="[TileId]" Template="IconicTile">
<wp:SmallIconImage Action="Clear">[sm icon img URI]</wp:SmallIconImage>
<wp:IconImage Action="Clear">[med/wd icon img URI]</wp:IconImage>
<wp:WideContent1 Action="Clear">[wd tile content line 1]</wp:WideContent1>
<wp:WideContent2 Action="Clear">[wd tile content line 2]</wp:WideContent2>
<wp:WideContent3 Action="Clear">[wd tile content line 3]</wp:WideContent3>
<wp:Count Action="Clear">[count]</wp:Count>
<wp:Title Action="Clear">[title text]</wp:Title>
<wp:BackgroundColor Action="Clear">[hex ARGB background color of tile]</wp:BackgroundColor>
</wp:Tile>
</wp:Notification>
3/18/201413
Raw Message Content
• Use the following HTTP headers:
• Where <batching interval> is 3 – Immediate delivery, 13 – delivered within 450 seconds, 23 –
delivered within 900 seconds
• Message Content is application-specific – only gets delivered to running app
• For example use XML to format data
14
string tileMessage = "<?xml version="1.0" encoding="utf-8"?>" +
"<root>" +
"<Value1>SomeUserValue<Value1>" +
"<Value2>SomeOtherUserValue<Value2>" +
"</root>";
sendNotificationRequest.ContentType = "text/xml";
sendNotificationRequest.Headers.Add("X-NotificationClass", "<batching interval>");
Demo:
Push Notifications
15
Response Custom Headers
• Response Code: HTTP status code (200 OK)
• Notification Status
• Notification received by the Push Notification Service
• For example: “X-NotificationStatus:Received”
• DeviceConnectionStatus
• The connection status of the device
• //For example: X-DeviceConnectionStatus:Connected
• SubscriptionStatus
• The subscription status
• //For example: X-SubscriptionStatus:Active
• More information
• http://msdn.microsoft.com/en-us/library/ff402545(v=VS.92).aspx
Review
• Push Notifications are an efficient and battery-friendly way of sending notifications from a
server to an app on a phone
• Raw notifications go only to a running app
• Toast notifications go to the app if it is running, otherwise display as a popup on the phone
• Tile notifications are used only to update tiles on the Start Screen
The information herein is for informational
purposes only an represents the current view of
Microsoft Corporation as of the date of this
presentation. Because Microsoft must respond
to changing market conditions, it should not be
interpreted to be a commitment on the part of
Microsoft, and Microsoft cannot guarantee the
accuracy of any information provided after the
date of this presentation.
© 2012 Microsoft Corporation.
All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries.
MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION
IN THIS PRESENTATION.

Weitere ähnliche Inhalte

Was ist angesagt?

Java networking programs socket based
Java networking programs socket basedJava networking programs socket based
Java networking programs socket basedMukesh Tekwani
 
Advanced WCF Workshop
Advanced WCF WorkshopAdvanced WCF Workshop
Advanced WCF WorkshopIdo Flatow
 
CNIT 124: Ch 8: Exploitation
CNIT 124: Ch 8: ExploitationCNIT 124: Ch 8: Exploitation
CNIT 124: Ch 8: ExploitationSam Bowne
 
Camelone-2012 HTML5 WebSocket ActiveMQ/Camel
Camelone-2012 HTML5 WebSocket ActiveMQ/CamelCamelone-2012 HTML5 WebSocket ActiveMQ/Camel
Camelone-2012 HTML5 WebSocket ActiveMQ/CamelCharles Moulliard
 
Websockets at tossug
Websockets at tossugWebsockets at tossug
Websockets at tossugclkao
 
Servletarchitecture,lifecycle,get,post
Servletarchitecture,lifecycle,get,postServletarchitecture,lifecycle,get,post
Servletarchitecture,lifecycle,get,postvamsi krishna
 
Introduction to Apache Web Services using latex
 Introduction to Apache Web Services using latex Introduction to Apache Web Services using latex
Introduction to Apache Web Services using latexManash Kumar Mondal
 
What is Node.js? (ICON UK)
What is Node.js? (ICON UK)What is Node.js? (ICON UK)
What is Node.js? (ICON UK)Tim Davis
 
Smuggling TCP traffic through HTTP
Smuggling TCP traffic through HTTPSmuggling TCP traffic through HTTP
Smuggling TCP traffic through HTTPDávid Halász
 
The Full Power of ASP.NET Web API
The Full Power of ASP.NET Web APIThe Full Power of ASP.NET Web API
The Full Power of ASP.NET Web APIEyal Vardi
 
Hack proof your ASP NET Applications
Hack proof your ASP NET ApplicationsHack proof your ASP NET Applications
Hack proof your ASP NET ApplicationsSarvesh Kushwaha
 
Apache Web Server Architecture Chaitanya Kulkarni
Apache Web Server Architecture Chaitanya KulkarniApache Web Server Architecture Chaitanya Kulkarni
Apache Web Server Architecture Chaitanya Kulkarniwebhostingguy
 
APACHE WEB SERVER FOR LINUX
APACHE WEB SERVER FOR LINUXAPACHE WEB SERVER FOR LINUX
APACHE WEB SERVER FOR LINUXwebhostingguy
 
Server-Side Programming Primer
Server-Side Programming PrimerServer-Side Programming Primer
Server-Side Programming PrimerIvano Malavolta
 
IBM Connect 2016 - Break out of the Box
IBM Connect 2016 - Break out of the BoxIBM Connect 2016 - Break out of the Box
IBM Connect 2016 - Break out of the BoxKarl-Henry Martinsson
 
Oracle virtual server-2-t0-3-upgrade
Oracle virtual server-2-t0-3-upgradeOracle virtual server-2-t0-3-upgrade
Oracle virtual server-2-t0-3-upgradeRavi Kumar Lanke
 

Was ist angesagt? (20)

Java networking programs socket based
Java networking programs socket basedJava networking programs socket based
Java networking programs socket based
 
Advanced WCF Workshop
Advanced WCF WorkshopAdvanced WCF Workshop
Advanced WCF Workshop
 
CNIT 124: Ch 8: Exploitation
CNIT 124: Ch 8: ExploitationCNIT 124: Ch 8: Exploitation
CNIT 124: Ch 8: Exploitation
 
Camelone-2012 HTML5 WebSocket ActiveMQ/Camel
Camelone-2012 HTML5 WebSocket ActiveMQ/CamelCamelone-2012 HTML5 WebSocket ActiveMQ/Camel
Camelone-2012 HTML5 WebSocket ActiveMQ/Camel
 
Websockets at tossug
Websockets at tossugWebsockets at tossug
Websockets at tossug
 
Servletarchitecture,lifecycle,get,post
Servletarchitecture,lifecycle,get,postServletarchitecture,lifecycle,get,post
Servletarchitecture,lifecycle,get,post
 
Introduction to Apache Web Services using latex
 Introduction to Apache Web Services using latex Introduction to Apache Web Services using latex
Introduction to Apache Web Services using latex
 
Cgi
CgiCgi
Cgi
 
What is Node.js? (ICON UK)
What is Node.js? (ICON UK)What is Node.js? (ICON UK)
What is Node.js? (ICON UK)
 
Smuggling TCP traffic through HTTP
Smuggling TCP traffic through HTTPSmuggling TCP traffic through HTTP
Smuggling TCP traffic through HTTP
 
ASP.NET WEB API
ASP.NET WEB APIASP.NET WEB API
ASP.NET WEB API
 
Nginx
NginxNginx
Nginx
 
The Full Power of ASP.NET Web API
The Full Power of ASP.NET Web APIThe Full Power of ASP.NET Web API
The Full Power of ASP.NET Web API
 
Hack proof your ASP NET Applications
Hack proof your ASP NET ApplicationsHack proof your ASP NET Applications
Hack proof your ASP NET Applications
 
Apache web server
Apache web serverApache web server
Apache web server
 
Apache Web Server Architecture Chaitanya Kulkarni
Apache Web Server Architecture Chaitanya KulkarniApache Web Server Architecture Chaitanya Kulkarni
Apache Web Server Architecture Chaitanya Kulkarni
 
APACHE WEB SERVER FOR LINUX
APACHE WEB SERVER FOR LINUXAPACHE WEB SERVER FOR LINUX
APACHE WEB SERVER FOR LINUX
 
Server-Side Programming Primer
Server-Side Programming PrimerServer-Side Programming Primer
Server-Side Programming Primer
 
IBM Connect 2016 - Break out of the Box
IBM Connect 2016 - Break out of the BoxIBM Connect 2016 - Break out of the Box
IBM Connect 2016 - Break out of the Box
 
Oracle virtual server-2-t0-3-upgrade
Oracle virtual server-2-t0-3-upgradeOracle virtual server-2-t0-3-upgrade
Oracle virtual server-2-t0-3-upgrade
 

Ähnlich wie Windows Phone 8 - 9 Push Notifications

08.Push Notifications
08.Push Notifications 08.Push Notifications
08.Push Notifications Nguyen Tuan
 
Sencha Roadshow 2017: Build Progressive Web Apps with Ext JS and Cmd
Sencha Roadshow 2017: Build Progressive Web Apps with Ext JS and Cmd Sencha Roadshow 2017: Build Progressive Web Apps with Ext JS and Cmd
Sencha Roadshow 2017: Build Progressive Web Apps with Ext JS and Cmd Sencha
 
WP8.1 Tiles and Notifications
WP8.1 Tiles and NotificationsWP8.1 Tiles and Notifications
WP8.1 Tiles and NotificationsPou Mason
 
MuleSoft ESB Message Enricher
MuleSoft ESB Message Enricher MuleSoft ESB Message Enricher
MuleSoft ESB Message Enricher akashdprajapati
 
HTML5/JavaScript Communication APIs - DPC 2014
HTML5/JavaScript Communication APIs - DPC 2014HTML5/JavaScript Communication APIs - DPC 2014
HTML5/JavaScript Communication APIs - DPC 2014Christian Wenz
 
14 tiles, notifications, and action center
14   tiles, notifications, and action center14   tiles, notifications, and action center
14 tiles, notifications, and action centerWindowsPhoneRocks
 
Hands-on with AWS IoT (November 2016)
Hands-on with AWS IoT (November 2016)Hands-on with AWS IoT (November 2016)
Hands-on with AWS IoT (November 2016)Julien SIMON
 
Web Real-time Communications
Web Real-time CommunicationsWeb Real-time Communications
Web Real-time CommunicationsAlexei Skachykhin
 
HTML5 vs Silverlight
HTML5 vs SilverlightHTML5 vs Silverlight
HTML5 vs SilverlightMatt Casto
 
Microsoft Windows Server AppFabric
Microsoft Windows Server AppFabricMicrosoft Windows Server AppFabric
Microsoft Windows Server AppFabricMark Ginnebaugh
 
Server-Sent Events in Action
Server-Sent Events in ActionServer-Sent Events in Action
Server-Sent Events in ActionAndrei Rusu
 
Building interactivity with websockets
Building interactivity with websocketsBuilding interactivity with websockets
Building interactivity with websocketsWim Godden
 
Middleware in Asp.Net Core
Middleware in Asp.Net CoreMiddleware in Asp.Net Core
Middleware in Asp.Net CoreShahriar Hossain
 
以Device Shadows與Rules Engine串聯實體世界
以Device Shadows與Rules Engine串聯實體世界以Device Shadows與Rules Engine串聯實體世界
以Device Shadows與Rules Engine串聯實體世界Amazon Web Services
 
XST - Cross Site Tracing
XST - Cross Site TracingXST - Cross Site Tracing
XST - Cross Site TracingMagno Logan
 
Mobile Software Engineering Crash Course - C06 WindowsPhone
Mobile Software Engineering Crash Course - C06 WindowsPhoneMobile Software Engineering Crash Course - C06 WindowsPhone
Mobile Software Engineering Crash Course - C06 WindowsPhoneMohammad Shaker
 
Webservices
WebservicesWebservices
Webservicess4al_com
 
Using communication and messaging API in the HTML5 world - GIl Fink, sparXsys
Using communication and messaging API in the HTML5 world - GIl Fink, sparXsysUsing communication and messaging API in the HTML5 world - GIl Fink, sparXsys
Using communication and messaging API in the HTML5 world - GIl Fink, sparXsysCodemotion Tel Aviv
 

Ähnlich wie Windows Phone 8 - 9 Push Notifications (20)

08.Push Notifications
08.Push Notifications 08.Push Notifications
08.Push Notifications
 
Sencha Roadshow 2017: Build Progressive Web Apps with Ext JS and Cmd
Sencha Roadshow 2017: Build Progressive Web Apps with Ext JS and Cmd Sencha Roadshow 2017: Build Progressive Web Apps with Ext JS and Cmd
Sencha Roadshow 2017: Build Progressive Web Apps with Ext JS and Cmd
 
WP8.1 Tiles and Notifications
WP8.1 Tiles and NotificationsWP8.1 Tiles and Notifications
WP8.1 Tiles and Notifications
 
MuleSoft ESB Message Enricher
MuleSoft ESB Message Enricher MuleSoft ESB Message Enricher
MuleSoft ESB Message Enricher
 
HTML5/JavaScript Communication APIs - DPC 2014
HTML5/JavaScript Communication APIs - DPC 2014HTML5/JavaScript Communication APIs - DPC 2014
HTML5/JavaScript Communication APIs - DPC 2014
 
14 tiles, notifications, and action center
14   tiles, notifications, and action center14   tiles, notifications, and action center
14 tiles, notifications, and action center
 
Hands-on with AWS IoT (November 2016)
Hands-on with AWS IoT (November 2016)Hands-on with AWS IoT (November 2016)
Hands-on with AWS IoT (November 2016)
 
Web Real-time Communications
Web Real-time CommunicationsWeb Real-time Communications
Web Real-time Communications
 
HTML5 vs Silverlight
HTML5 vs SilverlightHTML5 vs Silverlight
HTML5 vs Silverlight
 
Microsoft Windows Server AppFabric
Microsoft Windows Server AppFabricMicrosoft Windows Server AppFabric
Microsoft Windows Server AppFabric
 
Server-Sent Events in Action
Server-Sent Events in ActionServer-Sent Events in Action
Server-Sent Events in Action
 
Building interactivity with websockets
Building interactivity with websocketsBuilding interactivity with websockets
Building interactivity with websockets
 
Middleware in Asp.Net Core
Middleware in Asp.Net CoreMiddleware in Asp.Net Core
Middleware in Asp.Net Core
 
以Device Shadows與Rules Engine串聯實體世界
以Device Shadows與Rules Engine串聯實體世界以Device Shadows與Rules Engine串聯實體世界
以Device Shadows與Rules Engine串聯實體世界
 
XST - Cross Site Tracing
XST - Cross Site TracingXST - Cross Site Tracing
XST - Cross Site Tracing
 
Mobile Software Engineering Crash Course - C06 WindowsPhone
Mobile Software Engineering Crash Course - C06 WindowsPhoneMobile Software Engineering Crash Course - C06 WindowsPhone
Mobile Software Engineering Crash Course - C06 WindowsPhone
 
Intro to JavaScript
Intro to JavaScriptIntro to JavaScript
Intro to JavaScript
 
Webservices
WebservicesWebservices
Webservices
 
Using communication and messaging API in the HTML5 world - GIl Fink, sparXsys
Using communication and messaging API in the HTML5 world - GIl Fink, sparXsysUsing communication and messaging API in the HTML5 world - GIl Fink, sparXsys
Using communication and messaging API in the HTML5 world - GIl Fink, sparXsys
 
6 app-tcp
6 app-tcp6 app-tcp
6 app-tcp
 

Mehr von Oliver Scheer

Windows Phone 8 - 17 The Windows Phone Store
Windows Phone 8 - 17 The Windows Phone StoreWindows Phone 8 - 17 The Windows Phone Store
Windows Phone 8 - 17 The Windows Phone StoreOliver Scheer
 
Windows Phone 8 - 16 Wallet and In-app Purchase
Windows Phone 8 - 16 Wallet and In-app PurchaseWindows Phone 8 - 16 Wallet and In-app Purchase
Windows Phone 8 - 16 Wallet and In-app PurchaseOliver Scheer
 
Windows Phone 8 - 15 Location and Maps
Windows Phone 8 - 15 Location and MapsWindows Phone 8 - 15 Location and Maps
Windows Phone 8 - 15 Location and MapsOliver Scheer
 
Windows Phone 8 - 14 Using Speech
Windows Phone 8 - 14 Using SpeechWindows Phone 8 - 14 Using Speech
Windows Phone 8 - 14 Using SpeechOliver Scheer
 
Windows Phone 8 - 13 Near Field Communcations and Bluetooth
Windows Phone 8 - 13 Near Field Communcations and BluetoothWindows Phone 8 - 13 Near Field Communcations and Bluetooth
Windows Phone 8 - 13 Near Field Communcations and BluetoothOliver Scheer
 
Windows Phone 8 - 11 App to App Communication
Windows Phone 8 - 11 App to App CommunicationWindows Phone 8 - 11 App to App Communication
Windows Phone 8 - 11 App to App CommunicationOliver Scheer
 
Windows Phone 8 - 10 Using Phone Resources
Windows Phone 8 - 10 Using Phone ResourcesWindows Phone 8 - 10 Using Phone Resources
Windows Phone 8 - 10 Using Phone ResourcesOliver Scheer
 
Windows Phone 8 - 8 Tiles and Lock Screen Notifications
Windows Phone 8 - 8 Tiles and Lock Screen NotificationsWindows Phone 8 - 8 Tiles and Lock Screen Notifications
Windows Phone 8 - 8 Tiles and Lock Screen NotificationsOliver Scheer
 
Windows Phone 8 - 6 Background Agents
Windows Phone 8 - 6 Background AgentsWindows Phone 8 - 6 Background Agents
Windows Phone 8 - 6 Background AgentsOliver Scheer
 
Windows Phone 8 - 5 Application Lifecycle
Windows Phone 8 - 5 Application LifecycleWindows Phone 8 - 5 Application Lifecycle
Windows Phone 8 - 5 Application LifecycleOliver Scheer
 
Windows Phone 8 - 4 Files and Storage
Windows Phone 8 - 4 Files and StorageWindows Phone 8 - 4 Files and Storage
Windows Phone 8 - 4 Files and StorageOliver Scheer
 
Windows Phone 8 - 1 Introducing Windows Phone 8 Development
Windows Phone 8 - 1 Introducing Windows Phone 8 DevelopmentWindows Phone 8 - 1 Introducing Windows Phone 8 Development
Windows Phone 8 - 1 Introducing Windows Phone 8 DevelopmentOliver Scheer
 
Windows Phone 8 - 3 Building WP8 Applications
Windows Phone 8 - 3 Building WP8 ApplicationsWindows Phone 8 - 3 Building WP8 Applications
Windows Phone 8 - 3 Building WP8 ApplicationsOliver Scheer
 
Windows Phone 8 - 4 Files and Storage
Windows Phone 8 - 4 Files and StorageWindows Phone 8 - 4 Files and Storage
Windows Phone 8 - 4 Files and StorageOliver Scheer
 
Windows Phone 8 - 2 Designing WP8 Applications
Windows Phone 8 - 2 Designing WP8 ApplicationsWindows Phone 8 - 2 Designing WP8 Applications
Windows Phone 8 - 2 Designing WP8 ApplicationsOliver Scheer
 

Mehr von Oliver Scheer (15)

Windows Phone 8 - 17 The Windows Phone Store
Windows Phone 8 - 17 The Windows Phone StoreWindows Phone 8 - 17 The Windows Phone Store
Windows Phone 8 - 17 The Windows Phone Store
 
Windows Phone 8 - 16 Wallet and In-app Purchase
Windows Phone 8 - 16 Wallet and In-app PurchaseWindows Phone 8 - 16 Wallet and In-app Purchase
Windows Phone 8 - 16 Wallet and In-app Purchase
 
Windows Phone 8 - 15 Location and Maps
Windows Phone 8 - 15 Location and MapsWindows Phone 8 - 15 Location and Maps
Windows Phone 8 - 15 Location and Maps
 
Windows Phone 8 - 14 Using Speech
Windows Phone 8 - 14 Using SpeechWindows Phone 8 - 14 Using Speech
Windows Phone 8 - 14 Using Speech
 
Windows Phone 8 - 13 Near Field Communcations and Bluetooth
Windows Phone 8 - 13 Near Field Communcations and BluetoothWindows Phone 8 - 13 Near Field Communcations and Bluetooth
Windows Phone 8 - 13 Near Field Communcations and Bluetooth
 
Windows Phone 8 - 11 App to App Communication
Windows Phone 8 - 11 App to App CommunicationWindows Phone 8 - 11 App to App Communication
Windows Phone 8 - 11 App to App Communication
 
Windows Phone 8 - 10 Using Phone Resources
Windows Phone 8 - 10 Using Phone ResourcesWindows Phone 8 - 10 Using Phone Resources
Windows Phone 8 - 10 Using Phone Resources
 
Windows Phone 8 - 8 Tiles and Lock Screen Notifications
Windows Phone 8 - 8 Tiles and Lock Screen NotificationsWindows Phone 8 - 8 Tiles and Lock Screen Notifications
Windows Phone 8 - 8 Tiles and Lock Screen Notifications
 
Windows Phone 8 - 6 Background Agents
Windows Phone 8 - 6 Background AgentsWindows Phone 8 - 6 Background Agents
Windows Phone 8 - 6 Background Agents
 
Windows Phone 8 - 5 Application Lifecycle
Windows Phone 8 - 5 Application LifecycleWindows Phone 8 - 5 Application Lifecycle
Windows Phone 8 - 5 Application Lifecycle
 
Windows Phone 8 - 4 Files and Storage
Windows Phone 8 - 4 Files and StorageWindows Phone 8 - 4 Files and Storage
Windows Phone 8 - 4 Files and Storage
 
Windows Phone 8 - 1 Introducing Windows Phone 8 Development
Windows Phone 8 - 1 Introducing Windows Phone 8 DevelopmentWindows Phone 8 - 1 Introducing Windows Phone 8 Development
Windows Phone 8 - 1 Introducing Windows Phone 8 Development
 
Windows Phone 8 - 3 Building WP8 Applications
Windows Phone 8 - 3 Building WP8 ApplicationsWindows Phone 8 - 3 Building WP8 Applications
Windows Phone 8 - 3 Building WP8 Applications
 
Windows Phone 8 - 4 Files and Storage
Windows Phone 8 - 4 Files and StorageWindows Phone 8 - 4 Files and Storage
Windows Phone 8 - 4 Files and Storage
 
Windows Phone 8 - 2 Designing WP8 Applications
Windows Phone 8 - 2 Designing WP8 ApplicationsWindows Phone 8 - 2 Designing WP8 Applications
Windows Phone 8 - 2 Designing WP8 Applications
 

Kürzlich hochgeladen

"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxLoriGlavin3
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfPrecisely
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxNavinnSomaal
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfLoriGlavin3
 
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESSALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESmohitsingh558521
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 

Kürzlich hochgeladen (20)

"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptx
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptx
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdf
 
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESSALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 

Windows Phone 8 - 9 Push Notifications

  • 1. Oliver Scheer Senior Technical Evangelist Microsoft Deutschland http://the-oliver.com Push Notifications
  • 3. Push Notifications and Live Tiles • Push Notifications offer developers a way to send timely information relating to their applications even when they are not running + • Windows phone has the unique ability to provide the end user glanceable access to the information they care most about, via Live Tiles
  • 4. Push Notifications Server-initiated communication Enable key background scenarios Preserve battery life and user experience Prevent polling for updates
  • 5. Three Kinds of Notifications • Raw • Notification message content is application-specific • Delivered directly to app only if it is running • Toast • Specific XML schema • Content delivered to app if it is running • If app is not running, system displays Toast popup using notification message content • Tile • Specific XML schema • Never delivered to app • If the Tile is currently pinned to the Start screen, system updates it using notification message content 5
  • 6. Push Notification Data Flow URI to the service: "http://notify.live.com/throttledthirdparty/01.00/AAFRQHgiiMWNTYrRD XAHQtz-AgrNpzcDAwAAAAQOMDAwMDAwMDAwMDAwMDA" Push enabled applications Notifications service HTTP POST the message Push endpoint is established. URI is created for the endpoint. 1 2 3 Third-party service MPNS: Microsoft hosted server Send PN Message 4
  • 7. Push Notification Features • Tile updates can update any display element of each of the Tile templates • Be careful to downgrade updates sent to 7.1 clients • 30 subscription endpoints allowed per phone • Maximum size of a notification is 1KB for the header and 3KB for the payload. • Unauthenticated Web Service limited to 500 push notifications per subscription per day • Authenticated Web Services are recommended • Communication uses HTTPS channel • No limit • Able to register a callback request
  • 8. Toast Message Content •Used by system to display Toast message if app not running •Navigates to page specified in <Param> (if supplied) •If app is already running • ShellToastNotificationReceived event fires • <Text1> and <Text2> values in event args as Dictionary<string, string> 8
  • 9. Toast Message Content • Use the following HTTP headers: • Where <batching interval> is 3 – Immediate delivery, 13 – delivered within 450 seconds, 23 – delivered within 900 seconds 9 string toastMessage = "<?xml version="1.0" encoding="utf-8"?>" + "<wp:Notification xmlns:wp="WPNotification">" + "<wp:Toast>" + "<wp:Text1>WEATHER ALERT</wp:Text1>" + "<wp:Text2>Stormy</wp:Text2>" + "<wp:Param>/page1.xaml?value1=1234<wp:Param>" + "</wp:Toast>" + "</wp:Notification>"; sendNotificationRequest.ContentType = "text/xml"; sendNotificationRequest.Headers.Add("X-WindowsPhone-Target", "toast"); sendNotificationRequest.Headers.Add("X-NotificationClass", "<batching interval>");
  • 10. Tile Message Content 10 • Tile messages are never delivered to the app • There are specific schemas for the a Tile update message for each of the three Tile Templates: Flip, Cycle and Iconic • Only Tiles using Flip and Iconic templates can be updated with images at remote URLs • Remote Images limited to 80KB and must download in 30 seconds or less • V7.x clients cannot consume these new templates. Recommend you: • In your app, capture the device unique ID, the push URI, the OS version and the app version. Send this data to your Web service registration method • Make sure you only send the new templates to compatible new OS versions/app versions! • Use the following HTTP headers: sendNotificationRequest.ContentType = "text/xml"; sendNotificationRequest.Headers.Add("X-WindowsPhone-Target", “token"); sendNotificationRequest.Headers.Add("X-NotificationClass", "<batching interval>");
  • 11. FlipTile Template Tile Message Schema <?xml version="1.0"?> <wp:Notification xmlns:wp="WPNotification" Version="2.0"> <wp:Tile Id="[TileId]" Template="FlipTile"> <wp:SmallBackgroundImage Action="Clear">[sm tile img URI]</wp:SmallBackgroundImage> <wp:WideBackgroundImage Action="Clear">[front of wd tile img URI]</wp:WideBackgroundImage> <wp:WideBackBackgroundImage Action="Clear">[back of wd tile img URI]</wp:WideBackBackgroundImage> <wp:WideBackContent Action="Clear">[back of wd tile content text]</wp:WideBackContent> <wp:BackgroundImage Action="Clear">[front of med tile img URI]</wp:BackgroundImage> <wp:Count Action="Clear">[count]</wp:Count> <wp:Title Action="Clear">[title text]</wp:Title> <wp:BackBackgroundImage Action="Clear">[back of med tile img URI]</wp:BackBackgroundImage> <wp:BackTitle Action="Clear">[back of tile title text]</wp:BackTitle> <wp:BackContent Action="Clear">[back of med tile content text]</wp:BackContent> </wp:Tile> </wp:Notification> 3/18/201411
  • 12. CycleTile Template Tile Message Schema <?xml version="1.0"?> <wp:Notification xmlns:wp="WPNotification" Version="2.0"> <wp:Tile Id="[TileId]" Template="CycleTile"> <wp:SmallBackgroundImage Action="Clear">[sm tile img URI]</wp:SmallBackgroundImage> <wp:CycleImage1 Action="Clear">[photo 1 img URI]</wp:CycleImage1> <wp:CycleImage2 Action="Clear">[photo 2 img URI]</wp:CycleImage2> <wp:CycleImage3 Action="Clear">[photo 3 img URI]</wp:CycleImage3> <wp:CycleImage4 Action="Clear">[photo 4 img URI]</wp:CycleImage4> <wp:CycleImage5 Action="Clear">[photo 5 img URI]</wp:CycleImage5> <wp:CycleImage6 Action="Clear">[photo 6 img URI]</wp:CycleImage6> <wp:CycleImage7 Action="Clear">[photo 7 img URI]</wp:CycleImage7> <wp:CycleImage8 Action="Clear">[photo 8 img URI]</wp:CycleImage8> <wp:CycleImage9 Action="Clear">[photo 9 img URI]</wp:CycleImage9> <wp:Count Action="Clear">[count]</wp:Count> <wp:Title Action="Clear">[title text]</wp:Title> </wp:Tile> </wp:Notification> 3/18/201412
  • 13. IconicTile Template Tile Message Schema <?xml version="1.0"?> <wp:Notification xmlns:wp="WPNotification" Version="2.0"> <wp:Tile Id="[TileId]" Template="IconicTile"> <wp:SmallIconImage Action="Clear">[sm icon img URI]</wp:SmallIconImage> <wp:IconImage Action="Clear">[med/wd icon img URI]</wp:IconImage> <wp:WideContent1 Action="Clear">[wd tile content line 1]</wp:WideContent1> <wp:WideContent2 Action="Clear">[wd tile content line 2]</wp:WideContent2> <wp:WideContent3 Action="Clear">[wd tile content line 3]</wp:WideContent3> <wp:Count Action="Clear">[count]</wp:Count> <wp:Title Action="Clear">[title text]</wp:Title> <wp:BackgroundColor Action="Clear">[hex ARGB background color of tile]</wp:BackgroundColor> </wp:Tile> </wp:Notification> 3/18/201413
  • 14. Raw Message Content • Use the following HTTP headers: • Where <batching interval> is 3 – Immediate delivery, 13 – delivered within 450 seconds, 23 – delivered within 900 seconds • Message Content is application-specific – only gets delivered to running app • For example use XML to format data 14 string tileMessage = "<?xml version="1.0" encoding="utf-8"?>" + "<root>" + "<Value1>SomeUserValue<Value1>" + "<Value2>SomeOtherUserValue<Value2>" + "</root>"; sendNotificationRequest.ContentType = "text/xml"; sendNotificationRequest.Headers.Add("X-NotificationClass", "<batching interval>");
  • 16. Response Custom Headers • Response Code: HTTP status code (200 OK) • Notification Status • Notification received by the Push Notification Service • For example: “X-NotificationStatus:Received” • DeviceConnectionStatus • The connection status of the device • //For example: X-DeviceConnectionStatus:Connected • SubscriptionStatus • The subscription status • //For example: X-SubscriptionStatus:Active • More information • http://msdn.microsoft.com/en-us/library/ff402545(v=VS.92).aspx
  • 17. Review • Push Notifications are an efficient and battery-friendly way of sending notifications from a server to an app on a phone • Raw notifications go only to a running app • Toast notifications go to the app if it is running, otherwise display as a popup on the phone • Tile notifications are used only to update tiles on the Start Screen
  • 18. The information herein is for informational purposes only an represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. © 2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

Hinweis der Redaktion

  1. Push Notifications and Live TilesA user can choose to pin a tile to the Start Screen for any application, for contacts, groups of contacts, and for web pages. Apps can create secondary tiles.These tiles consist of text elements, an optional count and images, and these elements are ‘live’ and can be updated. In the Tiles and Lock Screen Notifications module, you learnt how to update the tiles :From apps, using the ShellTiles APIFrom background agents using the ShellTiles APIFrom ShellTileScheduleThe fourth way that tiles can be updated is from logic running on a backend server, which updates tiles by using the services of Microsoft Push Notifications Services (MPNS).
  2. Push NotificationsPush Notifications allows asynchronous messages to be sent to a phone. In the past, because of the nature of mobile phone networks, mobile software would usually poll a backend server to see if there was anything that had changed it was interested in. Unless you implemented costly wireless middleware, it was impossible to open a network connection to a mobile device to send it a message asynchronously – the software on the device had always to initiate the connection, to ‘call home’. Polling like this is very battery inefficient. Push Notifications is implemented to provide a mechanism to allow data to be sent to the device in a battery-efficient manner and in such a way that the user experience on the phone is not negatively affected. It works similar to email: long-lived HTTP requests are posted to the MPNS servers and the server only sends a response when it has some messages to deliver, but otherwise the request just sits there for a long time, until either it times out or a message is delivered. This is a very battery-efficient way of implementing this kind of messaging capability.
  3. Three Kinds of NotificationsThere are three types of push notifications that a web service can use when sending information to an application: toast, Tile, and raw notifications.Raw NotificationsYou can use a raw notification to send information to your application. If your application is not currently running, the raw notification is discarded on the Microsoft Push Notification Service and is not delivered to the device.Toast NotificationsA toast notification is displayed at the top of the screen to notify users of an event, such as a news or weather alert. The toast displays for about 10 seconds unless the user dismisses it with a flick to the right. If the user taps the toast, the application that sent the toast notification is launched.Tile NotificationsA Tile notification can be used to update a Tile on Start.
  4. Push Notification Data FlowThe diagram illustrates how Push works:Your client application running on the phone requests a push notification URI from the Push Notifications client service. The Push client service then negotiates with the Microsoft Push Notification Service (MPNS) and returns a notification URI to your client application Your client application can then send the URI to your cloud service. You must implement a web method on your service to allow client applications to register with your service, and you will have to implement some kind of list of registrations.When your web service has information to send to your client application, it uses the URI in sending a push notification to the Microsoft Push Notification Service.MPNS in turn routes the push notification to the application running on a Windows Phone device. Depending on the format of the push notification and the payload attached to it, the information is delivered as raw data to the application, the application&apos;s Tile is visually updated, or a toast notification is displayed. The Microsoft Push Notification Service sends a response code to your web service after a push notification is sent indicating that the notification has been received and will be delivered to the device at the next possible opportunity. However, the Microsoft Push Notification Service does not provide an end-to-end confirmation that your push notification was delivered from your web service to the device.
  5. Push Notification FeaturesEach phone can support up to 30 apps that have been run and requested a Push notifications subscription endpoint.From the server-side, you can have your web service run as unauthenticated, which means that it is limited to 500 push notifications per subscription – that means 500 to your app on each phone – not so much of a limit!However, if your web service is authenticated (which is recommended), there is no limit on the number of notifications, you communicate with MPNS over an HTTPS encrypted channel and you can set up a callback registration request that associates a callback URI and message with a subscription. After a callback is registered, if the device transitions into an inactive state, the Microsoft Push Notification Service will send the message to the callback URI. After the device returns to an active state, the web service should re-register the callback.
  6. Toast Message ContentThe payload for a Toast Notification must conform to a specific XML schema. This is because a toast notification is handled by the Push Notification Client Services layer if the app is not running – in this case it pops up a toast notification on the screen.If the app is running, and your code has subscribed to the appropriate event, the content of the toast message is delivered to the app.
  7. This is an example of a toast notification. You must also specify the headers as shown.
  8. Tile Message ContentThe payload for a Tile Update is never delivered to the app, and must again conform to a specific XML schema. The data in this message is handled by the Push Notifications Client Services layer on the phone and used to update tiles.Specify the headers on this notification as shown.
  9. Each of the new tile templates on Windows Phone 8 has it’s own specific XML schema for the messages.This one shows the FlipTile notification. Notice that you can clear any property on the tile by specifying the Action=&quot;Clear“ attribute.
  10. The CycleTile message can specify from one to nine images.Note, unlike with FlipTile or IconicTile, these images cannot be at remote (web) URLs. They must specify an image in the app package (using an ms-appx:/// URI) or an image in the local folder, using an ms-appdata:///local/shared/shellcontent URI).
  11. Finally, the IconicTile template schema
  12. Raw Message ContentThis is an example of the payload you can send for a RAW message. Since a RAW message is delivered only to your app, and only if it is the running application, the format of the payload is entirely application-specific, so can be anything you want.This example formats some data as XML.
  13. For demonstration notes please look in the “Demonstration” folder and open the corresponding Word document.
  14. Response Custom HeadersAfter your web service sends a push notification to the Microsoft Push Notification Service, your web service will receive one of many response codes with possible custom headers. The information you get back is rich and fairly complicated. The values you get may indicate that:The message has been queued OK and will be sent when possibleThe URI you passed is for an expired subscriptionThe target device may be ‘temporarily disconnected’You have exceeded the quota and must not send any more notifications for a certain period of timeYou should study the response codes as described in the documentation at the URI given on the slide so that you can implement the correct logic in your web service.
  15. ReviewPush Notifications are an efficient and battery-friendly way of sending notifications from a server to an app on a phoneRaw notifications go only to a running appToast notifications go to the app if it is running, otherwise display as a popup on the phone Tile notifications are used only to update tiles on the Start Screen