1/16/2019 8:14 PM SAC-863T Delivering notifications with the Windows Push Notification Service and Windows Azure Darren Louie, Nick Harris Program Manager,

Slides:



Advertisements
Similar presentations
© 2009 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered.
Advertisements

© 2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or.
Preface Demo A Quick Thank You How Did We Do It?
Windows 8 (1) (2) (3) Windows 8 (1) (2) (3)
Building Scalable Web Apps with Windows Azure Name Title Microsoft Corporation.
© 2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or.
© 2010 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered.
Feature: Purchase Requisitions - Requester © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names.
MIX 09 4/15/ :14 PM © 2009 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered.
Co- location Mass Market Managed Hosting ISV Hosting.
Windows 7 Training Microsoft Confidential. Windows ® 7 Compatibility Version Checking.
Feature: Purchase Order Prepayments II © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are.
Announcing Demo Announcing.
Feature: Web Client Keyboard Shortcuts © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are.
Session 1.
Built by Developers for Developers…. © 2009 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names.
Windows 8 (1) (2) (3) Windows 8 (1) (2) (3)
Connect with life Connect with life
Windows Azure Connect Name Title Microsoft Corporation.
NEXT: Overview – Sharing skills & code.
© 2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or.
Building Social Games for Windows 8 with Windows Azure Name Title Microsoft Corporation.
© 2009 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or.
demo Instance AInstance B Read “7” Write “8”

customer.
demo © 2008 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names.
demo Demo.
demo QueryForeign KeyInstance /sm:body()/x:Order/x:Delivery/y:TrackingId1Z
projekt202 © 2009 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are.
© 2009 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks.
© 2008 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or.

MIX 09 4/17/2018 4:41 PM © 2009 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered.
Build /4/2018 © 2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks.
Возможности Excel 2010, о которых следует знать
Azure Active Directory
Making apps social and connected with HTTP services
Title of Presentation 11/22/2018 3:34 PM
Deep dive on app data roaming
Building Windows Phone 7 Applications with the Windows Azure Platform
Title of Presentation 12/2/2018 3:48 PM
Building Windows 8 and Windows Azure apps
Introduction to Building Applications with Windows Azure
Building Mobile Solutions on Windows Azure – Part I
Getting started with Windows Azure
Optimize your website using ASP.NET and IIS8
TechEd /15/2019 8:08 PM © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks.
Create experiences that span devices
Create rich, data-driven Web apps with ASP.NET 4.5 Web Forms
Building device & cloud apps
8/04/2019 9:13 PM © 2006 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered.
Using tiles and notifications
SharePoint 2013 Authentication with Azure – Part 1
Windows 8 Security Internals
Виктор Хаджийски Катедра “Металургия на желязото и металолеене”
WINDOWS AZURE A LAP AROUND PLATFORM THE Steve Marx
PENSACOLA ENERGY WORK PLAN OCTOBER 10, 2016
Title of Presentation 5/12/ :53 PM
Шитманов Дархан Қаражанұлы Тарих пәнінің
Title of Presentation 5/24/2019 1:26 PM
5/24/2019 6:44 PM 1/8/18 Bell #10 In a world governed by the gods, is there any room for human will? Do human choices make a difference? EXPLAIN © 2007.
John Hazen Principal Program Manager Lead Microsoft Corporation
Developing Mobile Solutions with Windows Azure Part II
Title of Presentation 7/24/2019 8:53 PM
Build /27/2019 © 2015 Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION.
Erik Porter Program Manager ASP.NET Microsoft Corporation
WCL425 App Compat for Nerds Chris Jackson.
Presentation transcript:

1/16/2019 8:14 PM SAC-863T Delivering notifications with the Windows Push Notification Service and Windows Azure Darren Louie, Nick Harris Program Manager, Technical Evangelist Microsoft Corporation © 2010 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. The information herein is for informational purposes only and 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. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

Agenda Review of Live Tiles. A deeper look at using the Windows Push Notification Service. Introduction to the Windows Azure Toolkit for Windows 8. You’ll leave with examples of how to Enable push notifications for your service. Build a push enabled service using Windows Azure.

demo Live Tiles on Start 1/16/2019 8:14 PM © 2010 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. The information herein is for informational purposes only and 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. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

Live Tiles with Push Notifications

Windows Push Notification Service (WNS)

Push Notification Overview Windows 8 Notification Client Platform Metro Style App Cloud Service Request Channel URI Register with your Cloud Service Authenticate & Push Notification 2 3 1 Windows Push Notification Service 3

Windows Push Notification Service 1. Request a Channel URI Windows 8 Notification Client Platform Metro Style App Cloud Service Each tile has a unique Channel URI. Requested by App on each run. URI can change. Generated by WNS Opaque to the app. 2 3 1 Windows Push Notification Service 3

https://db3.notify.windows.com/?token=AQI8iP%2OtQE%3d 1. Request Channel URI var push = Windows.Networking.PushNotifications; var promise = push.PushNotificationChannelManager .createPushNotificationChannelForApplicationAsync(); https://db3.notify.windows.com/?token=AQI8iP%2OtQE%3d promise.then(function (ch) { var uri = ch.uri; var expiry = ch.expirationTime; updateChannelUri(uri, expiry); });

2. Register with your Cloud Service Windows 8 Notification Client Platform Metro App Windows 8 Notification Client Platform Metro Style App Cloud Service Cloud Service Register your app with your own Cloud Service. Should be authenticated and secure. Store Channel URI and associate it with any app specific context. Create your business logic for sending notifications. 2 1 1 Windows Push Notification Service Windows Push Notification Service

2. Register with your Cloud Service function updateChannelUri(channel, channelExpiration) { if (channel) { var serverUrl = "https://mysampleapp.cloudapp.net/register"; var payload = { Expiry: channelExpiration.toString(), URI: channel }; var xhr = new WinJS.xhr({ type: "POST", url: serverUrl, headers: { "Content-Type": "application/json; charset=utf-8" }, data: JSON.stringify(payload) }).then(function (req) { … }); }

3. Authenticate & Send Notification Windows 8 Notification Client Platform Metro Style App Cloud Service OAuth 2 Authentication. HTTP POST to Channel URI. XML notification payload. 2 3 Windows Push Notification Service 3

3. Register your App

3. Authentication HTTP Request POST https://login.live.com/accesstoken.srf HTTP/1.1 Content-Type: application/x-www-form-urlencoded Host: login.live.com Content-Length: 221 grant_type=client_credentials&client_id=ms-app%3A%2F%2FS-1-15-2-1633617344-1232597856-4562071667-7893084900-2692585271-282905334-531217761&client_secret=XEvTg3USjIpvdWLBFcv44sJHRKcid43QXWfNx3YiJ4g&scope=notify.windows.com

3. Authentication HTTP Response HTTP/1.1 200 OK Cache-Control: no-store Content-Length: 422 Content-Type: application/json Connection: close { "access_token":"EgAcAQMAAAAg/RBw++jdA1MzM0LTUzMTIxNzc2MQA=", "token_type":"bearer" }

3. Push Notification HTTP Request POST https://db3.notify.windows.com/?token=AQI8iP%2OtQE%3d HTTP/1.1 Content-Type: text/xml Host: db3.notify.windows.com X-WNS-Type: wns/badge Authorization: Bearer EgAcAQMAAAAg/RBw++jdA1MzM0LTUzMTIxNzc2MQA= Content-Length: 58 <?xml version="1.0" encoding="utf-8"?> <badge value="34"/>

3. Push Notification HTTP Response HTTP/1.1 200 OK Content-Length: 0 X-WNS-NOTIFICATIONSTATUS: received X-WNS-MSG-ID: 1ACD59E4683FE4BF X-WNS-DEBUG-TRACE: DB3WNS4011434 Important Notes Device can be offline or disconnected. Success indicates that the request was successfully received by WNS; not necessarily that the user saw it. Additional headers in the response for notification and device status.

Windows Push Notification Recipe <Conference/Group Name> 1/16/2019 8:14 PM announcing Windows Push Notification Recipe © 2010 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. The information herein is for informational purposes only and 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. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

Authentication Code using Windows.Recipes.Push.Notifications.Security; … // Constructor takes your Package SID and secret key IAccessTokenProvider _tokenProvider = new WNSAccessTokenProvider( "ms-app%3A%2F%2FS-1-15-2-1633617344-1232597856-4562071667-7893084900-2692585271-282905334-531217761", "XEvTg3USjIpvdWLBFcv44sJHRKcid43QXWfNx3YiJ4g");

Push Notification Code using Windows.Recipes.Push.Notifications; … var toast = new ToastNotification(_tokenProvider); toast.ChannelUrl = "https://db3.notify.windows.com/?token=AQI8iP%2OtQE%3d"; toast.ToastType = ToastType.ToastImageAndText02; toast.Image = "https://demosa.blob.core.windows.net/toastImg1.png"; toast.Text = new List<string> {"Miguel Saenz comment on your status", "I love that quote! How have you …"}; NotificationSendResult result = toast.Send();

Push Notification Overview Building a Cloud Service with Window Azure Windows 8 Notification Client Platform Metro Style App Cloud Service What a service needs to support How do I do that with Windows Azure? Secure, web based API for channel URI registration. Persistent storage of channel URI. Storage for tile and toast images. Windows Azure Compute Web Role Full IIS support WCF REST and ASP.NET MVC Windows Azure Storage Table Storage Blob Storage Request Channel URI Register with your Cloud Service Authenticate & Push Notification 2 3 1 Windows Push Notification Service 3

Windows Azure Toolkit for Windows 8 1/16/2019 8:14 PM announcing Windows Azure Toolkit for Windows 8 © 2010 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. The information herein is for informational purposes only and 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. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

Windows Azure provides the resources to scale your services as your app grows.

Windows Azure Services Core Services: Windows Azure Compute Windows Azure Storage Table Storage Blob Storage Services to Help Scale: Windows Azure Elastic Scale Windows Azure CDN Windows Azure Traffic Manager Windows Azure App Fabric Cache

Recap

Session Recap There are 3 easy steps to implement push notifications: Request Channel URI Register with your Cloud Service Authenticate & Push The Windows Push Notification Recipe helps you easily add push notifications to your service. The Windows Azure Toolkit for Windows 8 is the best way to start building a service. Windows Azure provides the resources to scale your services as your app grows.

Resources Register your app http://manage.dev.live.com/build Download the Windows Azure Toolkit for Windows 8 http://WATWindows8.codeplex.com Windows 8 Developer Documentation http://dev.windows.com

Sessions [APP-396T] Using tiles and notifications [SAC-850T] Getting started with Windows Azure [SAC-858T] Identity and access management for Windows Azure apps [SAC-868T] Building device & cloud apps [SAC-869T] Building global and highly-available services using Windows Azure [SAC-870T] Building scalable web apps with Windows Azure [SAC-871T] Building social games for Windows 8 with Windows Azure [SAC-961T] Inside Windows Azure storage: what's new and under the hood deep dive

thank you Feedback and questions http://forums.dev.windows.com Session feedback http://bldw.in/SessionFeedback

1/16/2019 8:14 PM © 2011 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. The information herein is for informational purposes only and 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. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION. © 2011 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. The information herein is for informational purposes only and 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. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.