Your SlideShare is downloading. ×
0
Me
adam grocholski

adgroc@microsoft.com
@codel8r
thinkfirstcodelater.com
Client app

Platform
Notification
Service

App back-end
Android app

Windows Store
app

App back-end

GCM

Notification Hub

WNS
//get the gcm id
GoogleCloudMessaging gcm = GoogleCloudMessaging.getInstance(context);
String gcmid = gcm.register(SENDER_...
//instantiate a new instance of NotificationHubClient
var hubClient =
NotificationHubClient.CreateClientFromConnectionStri...
No need to store and maintain gcmId.
Device registrations expire.
App back-end
Tag:”Beatles”

Notification Hub

Tag:”Wailers”

Tag:”Beatles”
//get the gcm id
GoogleCloudMessaging gcm = GoogleCloudMessaging.getInstance(context);
String gcmid = gcm.register(SENDER_...
//instantiate a new instance of NotificationHubClient
var hubClient =
NotificationHubClient.CreateClientFromConnectionStri...
Notification Hub
App back-end
<toast>
<visual>
<binding template="ToastText01">
<text id="1">$(message)</text>
</binding>
</visual>
</toast>

Hello!
{ m...
<toast>
<visual>
<binding template="ToastText01">
<text id="1">$(tempF)</text>
</binding>
</visual>
</toast>

73
{tempC: “...
//get the gcm id
GoogleCloudMessaging gcm = GoogleCloudMessaging.getInstance(context);
String gcmid = gcm.register(SENDER_...
//instantiate a new instance of NotificationHubClient
var hubClient =
NotificationHubClient.CreateClientFromConnectionStri...
What Next?
Try it out. For Free.
Build what you want. Scale as you need. Full access with no strings
attached.

http://aka...
Contact Me
adam grocholski

adgroc@microsoft.com
@codel8r
thinkfirstcodelater.com
Google DevFest MN - Windows Azure Notification Hubs
Google DevFest MN - Windows Azure Notification Hubs
Google DevFest MN - Windows Azure Notification Hubs
Google DevFest MN - Windows Azure Notification Hubs
Google DevFest MN - Windows Azure Notification Hubs
Google DevFest MN - Windows Azure Notification Hubs
Google DevFest MN - Windows Azure Notification Hubs
Google DevFest MN - Windows Azure Notification Hubs
Google DevFest MN - Windows Azure Notification Hubs
Google DevFest MN - Windows Azure Notification Hubs
Google DevFest MN - Windows Azure Notification Hubs
Google DevFest MN - Windows Azure Notification Hubs
Google DevFest MN - Windows Azure Notification Hubs
Google DevFest MN - Windows Azure Notification Hubs
Google DevFest MN - Windows Azure Notification Hubs
Google DevFest MN - Windows Azure Notification Hubs
Google DevFest MN - Windows Azure Notification Hubs
Google DevFest MN - Windows Azure Notification Hubs
Google DevFest MN - Windows Azure Notification Hubs
Google DevFest MN - Windows Azure Notification Hubs
Google DevFest MN - Windows Azure Notification Hubs
Google DevFest MN - Windows Azure Notification Hubs
Google DevFest MN - Windows Azure Notification Hubs
Google DevFest MN - Windows Azure Notification Hubs
Google DevFest MN - Windows Azure Notification Hubs
Upcoming SlideShare
Loading in...5
×

Google DevFest MN - Windows Azure Notification Hubs

761

Published on

Published in: Technology, Business
1 Comment
1 Like
Statistics
Notes
No Downloads
Views
Total Views
761
On Slideshare
0
From Embeds
0
Number of Embeds
4
Actions
Shares
0
Downloads
10
Comments
1
Likes
1
Embeds 0
No embeds

No notes for slide

Transcript of "Google DevFest MN - Windows Azure Notification Hubs"

  1. 1. Me adam grocholski adgroc@microsoft.com @codel8r thinkfirstcodelater.com
  2. 2. Client app Platform Notification Service App back-end
  3. 3. Android app Windows Store app App back-end GCM Notification Hub WNS
  4. 4. //get the gcm id GoogleCloudMessaging gcm = GoogleCloudMessaging.getInstance(context); String gcmid = gcm.register(SENDER_ID); //instantiate a new NotificationHub instance NotificationHub hub = new NotificationHub("<hub name>", "<connection string>", context); //register with the NotificationHub NativeRegistration r = hub.register(gcmid);
  5. 5. //instantiate a new instance of NotificationHubClient var hubClient = NotificationHubClient.CreateClientFromConnectionString("<connection string>", "<hub name>"); //create the json payload for the notification var payload = "{ "data" : {"msg":"Hello from Windows Azure!"}}"; //send notification via gcm hubClient.SendGcmNativeNotificationAsync(payload);
  6. 6. No need to store and maintain gcmId. Device registrations expire.
  7. 7. App back-end Tag:”Beatles” Notification Hub Tag:”Wailers” Tag:”Beatles”
  8. 8. //get the gcm id GoogleCloudMessaging gcm = GoogleCloudMessaging.getInstance(context); String gcmid = gcm.register(SENDER_ID); //instantiate a new NotificationHub instance NotificationHub hub = new NotificationHub("<hub name>", "<connection string>", context); //register with the NotificationHub using tags NativeRegistration r = hub.register(gcmid, "Beatles");
  9. 9. //instantiate a new instance of NotificationHubClient var hubClient = NotificationHubClient.CreateClientFromConnectionString("<connection string>", "<hub name>"); //create the json payload for the notification var payload = "{ "data" : {"msg":"Hello from Windows Azure!"}}"; //create a list of tags var tags = new List<string>(){ "Beatles" }; //send notification to devices registered with tags via gcm hubClient.SendGcmNativeNotificationAsync(payload, tags);
  10. 10. Notification Hub App back-end
  11. 11. <toast> <visual> <binding template="ToastText01"> <text id="1">$(message)</text> </binding> </visual> </toast> Hello! { message: “Hello!” } App back-end Service Bus Notification Hub Hello! { aps: { alert: “$(message)” } }
  12. 12. <toast> <visual> <binding template="ToastText01"> <text id="1">$(tempF)</text> </binding> </visual> </toast> 73 {tempC: “23”, tempF: “73”} App back-end Service Bus Notification Hub 23 { aps: { alert: “$(tempC)” } }
  13. 13. //get the gcm id GoogleCloudMessaging gcm = GoogleCloudMessaging.getInstance(context); String gcmid = gcm.register(SENDER_ID); //instantiate a new NotificationHub instance NotificationHub hub = new NotificationHub("<hub name>", "<connection string>", context); //create the template String template = "{ "data" : {"msg":"$(message)"}}"; //register with the NotificationHub using the template NativeRegistration r = hub.register(gcmid, "Template1", template, "Beatles");
  14. 14. //instantiate a new instance of NotificationHubClient var hubClient = NotificationHubClient.CreateClientFromConnectionString("<connection string>", "<hub name>"); //create expressions to substitute in the template var expressions = var Dictionary<string, string>(); expressions.Add("message", "hello"); //send template notification to all devices hubClient.SendTemplateNotificationAsync(expressions);
  15. 15. What Next? Try it out. For Free. Build what you want. Scale as you need. Full access with no strings attached. http://aka.ms/thecloud Hello startups! You have an ideas so brilliant it burns. BizSpark can help make it real. http://aka.ms/JoinBizSpark or CONTACT ME!
  16. 16. Contact Me adam grocholski adgroc@microsoft.com @codel8r thinkfirstcodelater.com
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×