Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
Azure
Notification Hub
Luca Di Fino
dev.luke2375@live.it
@luke2375
luke2375.wordpress.com
MICROSOFT MOBILE CAMP
ROMA, 12 F...
Agenda
• Overview
• Azure Notification Hub
• Let’s start
• Hub
• App
• Push
• Something more
• More notifications
• More c...
• Push Notifications offer developers a way
to send timely information relating to
their applications even when they are n...
• Users management
• Platform dependency
• Scale
• Refresh handles
• Multicast
• Routing
• Monitor and
telemetry
MOBILE CA...
MOBILE CAMP
ROMA, 12 Febbraio 2015
5
Azure
Notification Hub
MOBILE CAMP
ROMA, 12 Febbraio 2015
6
• Device token management
• Multiple platforms
• Scale
• Works with any backend
• .NET, Node.JS, REST API, PHP, Java, etc....
MOBILE CAMP
ROMA, 12 Febbraio 2015
8
Demo
MOBILE CAMP
ROMA, 12 Febbraio 2015
9
+
1. Create the notification hub – Azure
2. Get app SID and Secret – Dev Center (Windows or Windows Phone)
3. Configure hub
...
MOBILE CAMP
ROMA, 12 Febbraio 2015
11
MOBILE CAMP
ROMA, 12 Febbraio 2015
12
1
2
MOBILE CAMP
ROMA, 12 Febbraio 2015
13
1
2
MOBILE CAMP
ROMA, 12 Febbraio 2015
14
SID
Secret
MOBILE CAMP
ROMA, 12 Febbraio 2015
15
MOBILE CAMP
ROMA, 12 Febbraio 2015
16
string notificationHubPath = NOME_HUB;
string connectionString = DefaultListenShared...
• Add Nuget package WindowsAzure.ServiceBus
• Create the hub
• Send native notifications
MOBILE CAMP
ROMA, 12 Febbraio 201...
MOBILE CAMP
ROMA, 12 Febbraio 2015
18
ToastText01 ToastImageAndText01
MOBILE CAMP
ROMA, 12 Febbraio 2015
19
TileSquareImage/TileSquare150x150Image TileSquarePeekImageAndText02
• What if we want more granular control over notifications?
• If we want to push notifications only to people who are subs...
• When in Standard tier, Notification Hubs supports a feature that
enables you to schedule notifications up to 7 days in t...
MOBILE CAMP
ROMA, 12 Febbraio 2015
22
MOBILE CAMP
ROMA, 12 Febbraio 2015
23
var registration = await hub.RegisterNativeAsync(channel.Uri, tagsToSubscribeTo);
aw...
Notification Hub
• Azure
• MSDN
• Windows Store (WinRT) tutorial
• Windows Phone (Silverlight) tutorial
• Android tutorial...
MOBILE CAMP
ROMA, 12 Febbraio 2015
25
Q&A
MOBILE CAMP
ROMA, 12 Febbraio 2015
26
Feedback form
Upcoming SlideShare
Loading in …5
×

Azure Notification hub

1,020 views

Published on

Azure Notification Hubs is a massively scalable mobile push notification engine for quickly sending millions of messages to iOS, Android, Windows, or Kindle devices. Tailor notifications to specific users-or entire audiences-with just a few lines of code, and do it across any platform

Published in: Software
  • Be the first to comment

Azure Notification hub

  1. 1. Azure Notification Hub Luca Di Fino dev.luke2375@live.it @luke2375 luke2375.wordpress.com MICROSOFT MOBILE CAMP ROMA, 12 Febbraio 2015
  2. 2. Agenda • Overview • Azure Notification Hub • Let’s start • Hub • App • Push • Something more • More notifications • More channels • More apps • Q&A MOBILE CAMP ROMA, 12 Febbraio 2015
  3. 3. • Push Notifications offer developers a way to send timely information relating to their applications even when they are not running • Push notifications are delivered through platform-specific infrastructures called Platform Notification Systems (PNS) +Windows has the unique ability to provide the end user glanceable access to the information they care most about, via Live Tiles MOBILE CAMP ROMA, 12 Febbraio 2015 3 Back-end PNS Device 1 2 3 4 Retrieve PNS Handle Store PNS Handle Send Notification Send to Device
  4. 4. • Users management • Platform dependency • Scale • Refresh handles • Multicast • Routing • Monitor and telemetry MOBILE CAMP ROMA, 12 Febbraio 2015 4
  5. 5. MOBILE CAMP ROMA, 12 Febbraio 2015 5
  6. 6. Azure Notification Hub MOBILE CAMP ROMA, 12 Febbraio 2015 6
  7. 7. • Device token management • Multiple platforms • Scale • Works with any backend • .NET, Node.JS, REST API, PHP, Java, etc. • Efficient tag-based multicast and pub/sub routing • Personalization • Rich telemetry MOBILE CAMP ROMA, 12 Febbraio 2015
  8. 8. MOBILE CAMP ROMA, 12 Febbraio 2015 8
  9. 9. Demo MOBILE CAMP ROMA, 12 Febbraio 2015 9 +
  10. 10. 1. Create the notification hub – Azure 2. Get app SID and Secret – Dev Center (Windows or Windows Phone) 3. Configure hub 4. Create client app – Visual Studio 5. Create app backend MOBILE CAMP ROMA, 12 Febbraio 2015
  11. 11. MOBILE CAMP ROMA, 12 Febbraio 2015 11
  12. 12. MOBILE CAMP ROMA, 12 Febbraio 2015 12 1 2
  13. 13. MOBILE CAMP ROMA, 12 Febbraio 2015 13 1 2
  14. 14. MOBILE CAMP ROMA, 12 Febbraio 2015 14 SID Secret
  15. 15. MOBILE CAMP ROMA, 12 Febbraio 2015 15
  16. 16. MOBILE CAMP ROMA, 12 Febbraio 2015 16 string notificationHubPath = NOME_HUB; string connectionString = DefaultListenSharedAccessSignature; hub = new NotificationHub(notificationHubPath, connectionString); var channel = await PushNotificationChannelManager.CreatePushNotificationChannelForApplicationAsync(); await hub.RegisterNativeAsync(channel.Uri); • Add Nuget package WindowsAzure.Messaging.Managed • Set Toast capable in .appxmanifest • Create and register Notification Channel in app.xaml.cs
  17. 17. • Add Nuget package WindowsAzure.ServiceBus • Create the hub • Send native notifications MOBILE CAMP ROMA, 12 Febbraio 2015 17 private NotificationHubClient hub; hub = NotificationHubClient.CreateClientFromConnectionString(endpoint, hubname); await hub.SendWindowsNativeNotificationAsync(XMLpayload); //WinRT await hub.SendMpnsNativeNotificationAsync(XMLpayolad); //Silverlight await hub.SendAppleNativeNotificationAsync(JSONpayload); //iOS await hub.SendGcmNativeNotificationAsync(JSONpayload); //Android
  18. 18. MOBILE CAMP ROMA, 12 Febbraio 2015 18 ToastText01 ToastImageAndText01
  19. 19. MOBILE CAMP ROMA, 12 Febbraio 2015 19 TileSquareImage/TileSquare150x150Image TileSquarePeekImageAndText02
  20. 20. • What if we want more granular control over notifications? • If we want to push notifications only to people who are subscribed to a specific category, we use tags. App Backend Combine tags with AND (&&), OR (||), NOT (!) and parentheses. Tag expressions are limited to 20 tags if they contain only ORs; otherwise they are limited to 6 tags MOBILE CAMP ROMA, 12 Febbraio 2015 20 string[] tagsToSubscribeTo = { "phone", "news" }; await hub.RegisterNativeAsync(channel.Uri, tagsToSubscribeTo); await hub.SendWindowsNativeNotificationAsync(toast, "phone"); await hub.SendWindowsNativeNotificationAsync(toast, "phone && news"); await hub.SendWindowsNativeNotificationAsync(toast, "phone || news");
  21. 21. • When in Standard tier, Notification Hubs supports a feature that enables you to schedule notifications up to 7 days in the future • To cancel a scheduled notification There are no limits on the number of scheduled notifications you can send MOBILE CAMP ROMA, 12 Febbraio 2015 21 Notification notification = new AppleNotification("{"aps":{"alert":"Happy birthday!"}}"); var scheduled = await hub.ScheduleNotificationAsync(notification, new DateTime(2014, 7, 19, 0, 0, 0)); await hub.CancelNotificationAsync(scheduled.ScheduledNotificationId);
  22. 22. MOBILE CAMP ROMA, 12 Febbraio 2015 22
  23. 23. MOBILE CAMP ROMA, 12 Febbraio 2015 23 var registration = await hub.RegisterNativeAsync(channel.Uri, tagsToSubscribeTo); await hub.UnregisterAsync(registration); await hub.UnregisterNativeAsync(); await hub.UnregisterAllAsync(channel.Uri);
  24. 24. Notification Hub • Azure • MSDN • Windows Store (WinRT) tutorial • Windows Phone (Silverlight) tutorial • Android tutorial • iOS tutorial • Kindle tutorial Windows toast and tile template catalogs • Toast template catalog • Tile template catalog MOBILE CAMP ROMA, 12 Febbraio 2015 24
  25. 25. MOBILE CAMP ROMA, 12 Febbraio 2015 25
  26. 26. Q&A MOBILE CAMP ROMA, 12 Febbraio 2015 26 Feedback form

×