Google DevFest MN - Windows Azure Notification Hubs

75 %
25 %
Information about Google DevFest MN - Windows Azure Notification Hubs
Technology

Published on February 8, 2014

Author: agrocholski

Source: slideshare.net

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_ID); //instantiate a new NotificationHub instance NotificationHub hub = new NotificationHub("<hub name>", "<connection string>", context); //register with the NotificationHub NativeRegistration r = hub.register(gcmid);

//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);

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_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");

//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);

Notification Hub App back-end

<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)” } }

<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)” } }

//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");

//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);

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!

Contact Me adam grocholski adgroc@microsoft.com @codel8r thinkfirstcodelater.com

Add a comment

Related presentations

Presentación que realice en el Evento Nacional de Gobierno Abierto, realizado los ...

In this presentation we will describe our experience developing with a highly dyna...

Presentation to the LITA Forum 7th November 2014 Albuquerque, NM

Un recorrido por los cambios que nos generará el wearabletech en el futuro

Um paralelo entre as novidades & mercado em Wearable Computing e Tecnologias Assis...

Microsoft finally joins the smartwatch and fitness tracker game by introducing the...

Related pages

Google Devfest Singapore - OpenSocial - Technology

Share Google Devfest Singapore - OpenSocial. ... Google DevFest MN - Windows Azure Notification Hubs. Login or Join. Processing Login successful.
Read more

Google DevFest 2012 Presentation - Technology

Windows Azure ... touchactive-with-gae-and-gwt-google-50 devfest ... DevFest MN - Windows Azure Notification Hubs.
Read more

Session 2 Service Bus를이용한이벤트분산처리와 Notification Hub ...

Google GCM Apple APNS Windows ... •http://www.slideshare.net/agrocholski/google-devfest-mn-notification-hubs. 2 ... Azure Notification Hub와 Service Bus ...
Read more

[TD 2015]개발하기 바쁜데 푸시서버와 메시지큐는 있는거 쓸래요(김영재) - Docs.com

• 다음 중 Azure Notification Hub ... articles/notification- hubs-android ... agrocholski/google-devfest-mn-notification-hubs ...
Read more

개발하기 바쁜데 푸시와 메시지큐는 있는거 쓸래요 - Docs.com

http://www.asp.net/aspnet/overview/developing-apps-with-windows-azure/getting ... http://www.slideshare.net/agrocholski/google-devfest-mn-notification-hubs.
Read more