SlideShare ist ein Scribd-Unternehmen logo
1 von 41
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
Google DevFest MN - Windows Azure Notification Hubs

Weitere ähnliche Inhalte

Was ist angesagt?

Будь первым
Будь первымБудь первым
Будь первымFDConf
 
bank management system
bank management systembank management system
bank management systemAisha Aisha
 
All you need to know about Callbacks, Promises, Generators
All you need to know about Callbacks, Promises, GeneratorsAll you need to know about Callbacks, Promises, Generators
All you need to know about Callbacks, Promises, GeneratorsBrainhub
 
Jeroen Vloothuis Bend Kss To Your Will
Jeroen Vloothuis   Bend Kss To Your WillJeroen Vloothuis   Bend Kss To Your Will
Jeroen Vloothuis Bend Kss To Your WillVincenzo Barone
 
The Ring programming language version 1.5.2 book - Part 40 of 181
The Ring programming language version 1.5.2 book - Part 40 of 181The Ring programming language version 1.5.2 book - Part 40 of 181
The Ring programming language version 1.5.2 book - Part 40 of 181Mahmoud Samir Fayed
 
Curlin' for Docs
Curlin' for DocsCurlin' for Docs
Curlin' for DocsSmartLogic
 

Was ist angesagt? (6)

Будь первым
Будь первымБудь первым
Будь первым
 
bank management system
bank management systembank management system
bank management system
 
All you need to know about Callbacks, Promises, Generators
All you need to know about Callbacks, Promises, GeneratorsAll you need to know about Callbacks, Promises, Generators
All you need to know about Callbacks, Promises, Generators
 
Jeroen Vloothuis Bend Kss To Your Will
Jeroen Vloothuis   Bend Kss To Your WillJeroen Vloothuis   Bend Kss To Your Will
Jeroen Vloothuis Bend Kss To Your Will
 
The Ring programming language version 1.5.2 book - Part 40 of 181
The Ring programming language version 1.5.2 book - Part 40 of 181The Ring programming language version 1.5.2 book - Part 40 of 181
The Ring programming language version 1.5.2 book - Part 40 of 181
 
Curlin' for Docs
Curlin' for DocsCurlin' for Docs
Curlin' for Docs
 

Ähnlich wie Google DevFest MN - Windows Azure Notification Hubs

Dev fest 2020 taiwan how to debug microservices on kubernetes as a pros (ht...
Dev fest 2020 taiwan   how to debug microservices on kubernetes as a pros (ht...Dev fest 2020 taiwan   how to debug microservices on kubernetes as a pros (ht...
Dev fest 2020 taiwan how to debug microservices on kubernetes as a pros (ht...KAI CHU CHUNG
 
Android Cloud to Device Messaging Framework at GTUG Stockholm
Android Cloud to Device Messaging Framework at GTUG StockholmAndroid Cloud to Device Messaging Framework at GTUG Stockholm
Android Cloud to Device Messaging Framework at GTUG StockholmJohan Nilsson
 
MAF push notifications
MAF push notificationsMAF push notifications
MAF push notificationsLuc Bors
 
Build resource server &amp; client for OCF Cloud (2018.8.30)
Build resource server &amp; client for OCF Cloud (2018.8.30)Build resource server &amp; client for OCF Cloud (2018.8.30)
Build resource server &amp; client for OCF Cloud (2018.8.30)남균 김
 
The Open Web and what it means
The Open Web and what it meansThe Open Web and what it means
The Open Web and what it meansRobert Nyman
 
Joe Walker Interactivewebsites Cometand Dwr
Joe Walker Interactivewebsites Cometand DwrJoe Walker Interactivewebsites Cometand Dwr
Joe Walker Interactivewebsites Cometand Dwrdeimos
 
Scaling push notifications to millions of devices using notification hubs
Scaling push notifications to millions of devices using notification hubsScaling push notifications to millions of devices using notification hubs
Scaling push notifications to millions of devices using notification hubscloudbeatsch
 
St. Louis Day of .NET 2013 - Delivering Push Notifications to Millions of Mob...
St. Louis Day of .NET 2013 - Delivering Push Notifications to Millions of Mob...St. Louis Day of .NET 2013 - Delivering Push Notifications to Millions of Mob...
St. Louis Day of .NET 2013 - Delivering Push Notifications to Millions of Mob...Adam Grocholski
 
Developing for Chromecast on Android
Developing for Chromecast on AndroidDeveloping for Chromecast on Android
Developing for Chromecast on AndroidKurt Mbanje
 
Android chat in the cloud
Android chat in the cloudAndroid chat in the cloud
Android chat in the cloudfirenze-gtug
 
Cnam azure 2014 mobile services
Cnam azure 2014   mobile servicesCnam azure 2014   mobile services
Cnam azure 2014 mobile servicesAymeric Weinbach
 
Google Web Toolkits
Google Web ToolkitsGoogle Web Toolkits
Google Web ToolkitsYiguang Hu
 
A Node.js Developer's Guide to Bluemix
A Node.js Developer's Guide to BluemixA Node.js Developer's Guide to Bluemix
A Node.js Developer's Guide to Bluemixibmwebspheresoftware
 
JavaScript APIs - The Web is the Platform
JavaScript APIs - The Web is the PlatformJavaScript APIs - The Web is the Platform
JavaScript APIs - The Web is the PlatformRobert Nyman
 
Building the an End-to-End ASP.NET MVC 4, Entity Framework, HTML5, jQuery app...
Building the an End-to-End ASP.NET MVC 4, Entity Framework, HTML5, jQuery app...Building the an End-to-End ASP.NET MVC 4, Entity Framework, HTML5, jQuery app...
Building the an End-to-End ASP.NET MVC 4, Entity Framework, HTML5, jQuery app...Dan Wahlin
 
Push Notification in IBM MobileFirst Xamarin SDK
Push Notification in IBM MobileFirst Xamarin SDKPush Notification in IBM MobileFirst Xamarin SDK
Push Notification in IBM MobileFirst Xamarin SDKAjay Chebbi
 
Magento 2 Seminar - Anton Kril - Magento 2 Summary
Magento 2 Seminar - Anton Kril - Magento 2 SummaryMagento 2 Seminar - Anton Kril - Magento 2 Summary
Magento 2 Seminar - Anton Kril - Magento 2 SummaryYireo
 

Ähnlich wie Google DevFest MN - Windows Azure Notification Hubs (20)

GCM aperitivo Android
GCM aperitivo AndroidGCM aperitivo Android
GCM aperitivo Android
 
Dev fest 2020 taiwan how to debug microservices on kubernetes as a pros (ht...
Dev fest 2020 taiwan   how to debug microservices on kubernetes as a pros (ht...Dev fest 2020 taiwan   how to debug microservices on kubernetes as a pros (ht...
Dev fest 2020 taiwan how to debug microservices on kubernetes as a pros (ht...
 
Android Cloud to Device Messaging Framework at GTUG Stockholm
Android Cloud to Device Messaging Framework at GTUG StockholmAndroid Cloud to Device Messaging Framework at GTUG Stockholm
Android Cloud to Device Messaging Framework at GTUG Stockholm
 
MAF push notifications
MAF push notificationsMAF push notifications
MAF push notifications
 
Build resource server &amp; client for OCF Cloud (2018.8.30)
Build resource server &amp; client for OCF Cloud (2018.8.30)Build resource server &amp; client for OCF Cloud (2018.8.30)
Build resource server &amp; client for OCF Cloud (2018.8.30)
 
The Open Web and what it means
The Open Web and what it meansThe Open Web and what it means
The Open Web and what it means
 
Joe Walker Interactivewebsites Cometand Dwr
Joe Walker Interactivewebsites Cometand DwrJoe Walker Interactivewebsites Cometand Dwr
Joe Walker Interactivewebsites Cometand Dwr
 
Scaling push notifications to millions of devices using notification hubs
Scaling push notifications to millions of devices using notification hubsScaling push notifications to millions of devices using notification hubs
Scaling push notifications to millions of devices using notification hubs
 
St. Louis Day of .NET 2013 - Delivering Push Notifications to Millions of Mob...
St. Louis Day of .NET 2013 - Delivering Push Notifications to Millions of Mob...St. Louis Day of .NET 2013 - Delivering Push Notifications to Millions of Mob...
St. Louis Day of .NET 2013 - Delivering Push Notifications to Millions of Mob...
 
Developing for Chromecast on Android
Developing for Chromecast on AndroidDeveloping for Chromecast on Android
Developing for Chromecast on Android
 
Android chat in the cloud
Android chat in the cloudAndroid chat in the cloud
Android chat in the cloud
 
Cnam azure 2014 mobile services
Cnam azure 2014   mobile servicesCnam azure 2014   mobile services
Cnam azure 2014 mobile services
 
Google Web Toolkits
Google Web ToolkitsGoogle Web Toolkits
Google Web Toolkits
 
Android Froyo
Android FroyoAndroid Froyo
Android Froyo
 
A Node.js Developer's Guide to Bluemix
A Node.js Developer's Guide to BluemixA Node.js Developer's Guide to Bluemix
A Node.js Developer's Guide to Bluemix
 
JavaScript APIs - The Web is the Platform
JavaScript APIs - The Web is the PlatformJavaScript APIs - The Web is the Platform
JavaScript APIs - The Web is the Platform
 
Building the an End-to-End ASP.NET MVC 4, Entity Framework, HTML5, jQuery app...
Building the an End-to-End ASP.NET MVC 4, Entity Framework, HTML5, jQuery app...Building the an End-to-End ASP.NET MVC 4, Entity Framework, HTML5, jQuery app...
Building the an End-to-End ASP.NET MVC 4, Entity Framework, HTML5, jQuery app...
 
Push Notification in IBM MobileFirst Xamarin SDK
Push Notification in IBM MobileFirst Xamarin SDKPush Notification in IBM MobileFirst Xamarin SDK
Push Notification in IBM MobileFirst Xamarin SDK
 
Magento 2 Seminar - Anton Kril - Magento 2 Summary
Magento 2 Seminar - Anton Kril - Magento 2 SummaryMagento 2 Seminar - Anton Kril - Magento 2 Summary
Magento 2 Seminar - Anton Kril - Magento 2 Summary
 
Serverless
ServerlessServerless
Serverless
 

Kürzlich hochgeladen

A Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source MilvusA Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source MilvusZilliz
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAndrey Devyatkin
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...Zilliz
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CVKhem
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businesspanagenda
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...apidays
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWERMadyBayot
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingEdi Saputra
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxRustici Software
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...apidays
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfOverkill Security
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MIND CTI
 

Kürzlich hochgeladen (20)

A Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source MilvusA Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source Milvus
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdf
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 

Google DevFest MN - Windows Azure Notification Hubs

  • 1.
  • 3.
  • 4.
  • 5.
  • 6.
  • 7.
  • 8.
  • 9.
  • 10.
  • 11.
  • 12.
  • 14.
  • 15. Android app Windows Store app App back-end GCM Notification Hub WNS
  • 16.
  • 17.
  • 18. //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);
  • 19. //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);
  • 20. No need to store and maintain gcmId. Device registrations expire.
  • 21.
  • 23. //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");
  • 24. //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);
  • 25.
  • 26.
  • 28.
  • 29.
  • 30. <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)” } }
  • 31. <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)” } }
  • 32. //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");
  • 33. //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);
  • 34.
  • 35.
  • 36.
  • 37.
  • 38.
  • 39. 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!