![Page 1: Delivering Millions of Push Notifications in Minutes](https://reader036.vdocuments.mx/reader036/viewer/2022062513/554f9ff4b4c905ad218b49a0/html5/thumbnails/1.jpg)
![Page 2: Delivering Millions of Push Notifications in Minutes](https://reader036.vdocuments.mx/reader036/viewer/2022062513/554f9ff4b4c905ad218b49a0/html5/thumbnails/2.jpg)
Laat ons weten wat u vindt van deze sessie! Vul de evaluatie in via www.techdaysapp.nl en maak kans op een van de 20 prijzen*. Prijswinnaars worden bekend gemaakt via Twitter (#TechDaysNL). Gebruik hiervoor de code op uw badge.
Let us know how you feel about this session! Give your feedback via www.techdaysapp.nl and possibly win one of the 20 prizes*. Winners will be announced via Twitter (#TechDaysNL). Use your personal code on your badge.
* Over de uitslag kan niet worden gecorrespondeerd, prijzen zijn voorbeelden – All results are final, prizes are examples
![Page 3: Delivering Millions of Push Notifications in Minutes](https://reader036.vdocuments.mx/reader036/viewer/2022062513/554f9ff4b4c905ad218b49a0/html5/thumbnails/3.jpg)
Delivering Millions of Push Notifications in MinutesSasha GoldshteinCTO, Sela GroupMicrosoft C# MVP, Azure MRS, Azure Insiderblog.sashag.net@goldshtn
![Page 4: Delivering Millions of Push Notifications in Minutes](https://reader036.vdocuments.mx/reader036/viewer/2022062513/554f9ff4b4c905ad218b49a0/html5/thumbnails/4.jpg)
Typical Push System Diagram
Platform Push Provider
Your Web Service
Database
App
![Page 5: Delivering Millions of Push Notifications in Minutes](https://reader036.vdocuments.mx/reader036/viewer/2022062513/554f9ff4b4c905ad218b49a0/html5/thumbnails/5.jpg)
Azure Mobile Services is a backend for your mobile apps
… that has a free tier… cloud scale… support for all mobile platforms
![Page 6: Delivering Millions of Push Notifications in Minutes](https://reader036.vdocuments.mx/reader036/viewer/2022062513/554f9ff4b4c905ad218b49a0/html5/thumbnails/6.jpg)
Mobile Services Push Architecture
Microsoft Azure
SQL DatabaseNode
+ Expres
s backen
d
Apple Push Notification
Service
Windows Notification
Service
Google Cloud Messaging
Microsoft Push
Notification Service
URI/Token
Device Type
ID
aabc 43df …
iOS 123456
https://live...
Windows 8 789123
56aaffbb…
Android 456789
Server scripts
Managed by you
![Page 7: Delivering Millions of Push Notifications in Minutes](https://reader036.vdocuments.mx/reader036/viewer/2022062513/554f9ff4b4c905ad218b49a0/html5/thumbnails/7.jpg)
Azure Notification Hubs
… abstract away platform push services… support targeted multi-tag delivery… scale to millions of users
… Mobile Services or any other backend
![Page 8: Delivering Millions of Push Notifications in Minutes](https://reader036.vdocuments.mx/reader036/viewer/2022062513/554f9ff4b4c905ad218b49a0/html5/thumbnails/8.jpg)
Notification Hub Push Architecture
Microsoft Azure
Node +
Express
backend
Apple Push Notification
Service
Windows Notification
Service
Google Cloud Messaging
Microsoft Push
Notification Service
Server scripts
Notification Hub Service
SQL Database
Tag URIs/Tokens
Templates
sports [ ab…, 5a…, …]
alert: …<toast…>data: …
news [ bc…, 5a…, …]
123456 [ 5a… ]
Not managed
by you
![Page 9: Delivering Millions of Push Notifications in Minutes](https://reader036.vdocuments.mx/reader036/viewer/2022062513/554f9ff4b4c905ad218b49a0/html5/thumbnails/9.jpg)
Options for Push Notifications
Registration Push
Through Mobile ServiceExplicit channel managementMobile Services push module
Directly from client to Notification Hub
Azure hub module from Mobile Service
Azure NuGet package from other backend
Through Mobile Service to Notification Hub
![Page 10: Delivering Millions of Push Notifications in Minutes](https://reader036.vdocuments.mx/reader036/viewer/2022062513/554f9ff4b4c905ad218b49a0/html5/thumbnails/10.jpg)
Registration Tags……are totally up to you!Examples:
user:123456 region:Europesports news
conversation:aa412group:Colleagues_65523
![Page 11: Delivering Millions of Push Notifications in Minutes](https://reader036.vdocuments.mx/reader036/viewer/2022062513/554f9ff4b4c905ad218b49a0/html5/thumbnails/11.jpg)
Per-Platform Registration fromMobile Servicehub.wns.createNativeRegistration( request.body.channelUri, [request.user.userId, “sports”], function (error, registration) { ... });hub.apns.createNativeRegistration( request.body.deviceToken, [request.user.userId, “sports”], function (error, registration) { ... });
![Page 12: Delivering Millions of Push Notifications in Minutes](https://reader036.vdocuments.mx/reader036/viewer/2022062513/554f9ff4b4c905ad218b49a0/html5/thumbnails/12.jpg)
Direct Registration fromWindows 8 Clientvar channel = await PushNotificationChannelManager.CreatePushNotificationChannelForApplicationAsync();
var hub = new NotificationHub(name, connString);await hub.RegisterNativeAsync(channel.Uri);
![Page 13: Delivering Millions of Push Notifications in Minutes](https://reader036.vdocuments.mx/reader036/viewer/2022062513/554f9ff4b4c905ad218b49a0/html5/thumbnails/13.jpg)
Push from Mobile Servicehub.wns.sendToastText02( [ ‘sports’, ‘news’ ], { text1: ‘Breaking news’, text2: ‘AFC Ajax defeats FC Twente 3-0’ }, function (error) { ... });
![Page 14: Delivering Millions of Push Notifications in Minutes](https://reader036.vdocuments.mx/reader036/viewer/2022062513/554f9ff4b4c905ad218b49a0/html5/thumbnails/14.jpg)
Push from Mobile Servicehub.apns.send ( [ ‘sports’, ‘news’ ], { badge: 1, alert: ‘AFC Ajax defeats FC Twente 3-0’ }, function (error) { ... });
![Page 15: Delivering Millions of Push Notifications in Minutes](https://reader036.vdocuments.mx/reader036/viewer/2022062513/554f9ff4b4c905ad218b49a0/html5/thumbnails/15.jpg)
Push from Other .NET Backendvar hub = NotificationHubClient. CreateClientFromConnectionString(connString, name);
var toast =@”...<text id=‘1’>”“AFC Ajax defeats FC Twente 3-0”“</text>...”;
await hub.SendWindowsNativeNotificationAsync(toast);
![Page 16: Delivering Millions of Push Notifications in Minutes](https://reader036.vdocuments.mx/reader036/viewer/2022062513/554f9ff4b4c905ad218b49a0/html5/thumbnails/16.jpg)
DemoNotification Hubs with .NET BackendNotification Hubs from Console App
![Page 17: Delivering Millions of Push Notifications in Minutes](https://reader036.vdocuments.mx/reader036/viewer/2022062513/554f9ff4b4c905ad218b49a0/html5/thumbnails/17.jpg)
Per-Platform Registrations Aren’t That Great
Separate registration API for each platformSeparate payload for each platform
But: More control over push customization
![Page 18: Delivering Millions of Push Notifications in Minutes](https://reader036.vdocuments.mx/reader036/viewer/2022062513/554f9ff4b4c905ad218b49a0/html5/thumbnails/18.jpg)
Template Registrationhub.wns.createToastText01Registration( request.body.channelUri, [ ‘sports’, request.user.userId ], { text1: ‘$(breakingnews)’ }, function (error, registration) { ... });hub.apns.createTemplateRegistration( request.body.deviceToken, [ ‘sports’, request.user.userId ], { aps: { alert: ‘$(breakingnews)’ } }, function (error, registration) { ... });
![Page 19: Delivering Millions of Push Notifications in Minutes](https://reader036.vdocuments.mx/reader036/viewer/2022062513/554f9ff4b4c905ad218b49a0/html5/thumbnails/19.jpg)
Registration
Template Channel URI / Device Token
Device Type
12345678… {“aps”:{“alert”:”$(breakingnews)”}} abcd 12f0 … iOS
45678901… {“data”:{“message”:”$(breakingnews)”}} 556a432f… Android
78901234… <?xml version="1.0" encoding="utf-8"?><wp:Notification xmlns:wp="WPNotification"><wp:Toast><wp:Text1>Breaking news</wp:Text1><wp:Text2>$(breakingnews)</wp:Text2></wp:Toast></wp:Notification>
https://live... Windows Phone
34567890… <toast><visual><binding template="ToastText02"><text id="1">Breaking news</text><text id="2">$(breakingnews)</text</visual></toast>
https://live... Windows 8
![Page 20: Delivering Millions of Push Notifications in Minutes](https://reader036.vdocuments.mx/reader036/viewer/2022062513/554f9ff4b4c905ad218b49a0/html5/thumbnails/20.jpg)
Template Pushhub.send( [ ‘sports’, ‘news’ ], { breakingnews: ‘AFC Ajax defeats FC Twente 3-0’ }, function (error, outcome) { ... });
![Page 21: Delivering Millions of Push Notifications in Minutes](https://reader036.vdocuments.mx/reader036/viewer/2022062513/554f9ff4b4c905ad218b49a0/html5/thumbnails/21.jpg)
DemoTemplate Registrations
![Page 22: Delivering Millions of Push Notifications in Minutes](https://reader036.vdocuments.mx/reader036/viewer/2022062513/554f9ff4b4c905ad218b49a0/html5/thumbnails/22.jpg)
Questions?Sasha Goldshteinblog.sashag.net@goldshtn
![Page 23: Delivering Millions of Push Notifications in Minutes](https://reader036.vdocuments.mx/reader036/viewer/2022062513/554f9ff4b4c905ad218b49a0/html5/thumbnails/23.jpg)
Laat ons weten wat u vindt van deze sessie! Vul de evaluatie in via www.techdaysapp.nl en maak kans op een van de 20 prijzen*. Prijswinnaars worden bekend gemaakt via Twitter (#TechDaysNL). Gebruik hiervoor de code op uw badge.
Let us know how you feel about this session! Give your feedback via www.techdaysapp.nl and possibly win one of the 20 prizes*. Winners will be announced via Twitter (#TechDaysNL). Use your personal code on your badge.
* Over de uitslag kan niet worden gecorrespondeerd, prijzen zijn voorbeelden – All results are final, prizes are examples
![Page 24: Delivering Millions of Push Notifications in Minutes](https://reader036.vdocuments.mx/reader036/viewer/2022062513/554f9ff4b4c905ad218b49a0/html5/thumbnails/24.jpg)