SlideShare a Scribd company logo
St. Louis Day of .NET 2013 - Delivering Push Notifications to Millions of Mobile Devices
http://bit.ly/1eUqxYS
Platinum
Sponsors

Gold Sponsors

Silver
Sponsors
Contact Me
adam grocholski

adgroc@microsoft.com
@codel8r
thinkfirstcodelater.com
St. Louis Day of .NET 2013 - Delivering Push Notifications to Millions of Mobile Devices
St. Louis Day of .NET 2013 - Delivering Push Notifications to Millions of Mobile Devices
St. Louis Day of .NET 2013 - Delivering Push Notifications to Millions of Mobile Devices
Windows News app uses
Notification Hubs
St. Louis Day of .NET 2013 - Delivering Push Notifications to Millions of Mobile Devices
Client app

Platform
Notification
Service

App back-end
St. Louis Day of .NET 2013 - Delivering Push Notifications to Millions of Mobile Devices
St. Louis Day of .NET 2013 - Delivering Push Notifications to Millions of Mobile Devices
iOS app

Windows Store
app

App back-end

APNs

Notification Hub

WNS
St. Louis Day of .NET 2013 - Delivering Push Notifications to Millions of Mobile Devices
St. Louis Day of .NET 2013 - Delivering Push Notifications to Millions of Mobile Devices
var hub = new NotificationHub(“<hub name>", "<connection string>");
var channel = await
PushNotificationChannelManager.CreatePushNotificationChannelForApplicationAsync();
await hub.RegisterNativeAsync(channel.Uri);
var hubClient =
NotificationHubClient.CreateClientFromConnectionString("<connection
string>", “<hub name>");
var toast = @“<notification payload>";
hubClient.SendWindowsNativeNotificationAsync(toast);
(void)application:(UIApplication *)application
didRegisterForRemoteNotificationsWithDeviceToken:(NSData *) deviceToken {
…
SBNotificationHub* hub = [[SBNotificationHub alloc] initWithConnectionString:
@"<connection string>" notificationHubPath:@"mynh"];
[hub registerNativeWithDeviceToken:deviceToken tags:nil completion:^(NSError* error) {
if (error != nil) {
NSLog(@"Error registering for notifications: %@", error);
}
}];
}
In your main activity:

Notification Hub hub = new NotificationHub("<hub name>", "<connection
string>", context);

GoogleCloudMessaging gcm = GoogleCloudMessaging.getInstance(context);
String regid = gcm.register(SENDER_ID);
NativeRegistration r = hub.register(regid);
var hubClient =
NotificationHubClient.CreateClientFromConnectionString("<connection
string>", “<hub name>");
var toastForIos = @“<notification payload>";
hubClient.SendAppleNativeNotificationAsync(toastForIos);

var toastForAndroid = @“<notification payload>";
hubClient.SendGcmNativeNotificationAsync(toastForAndroid);
var azure = require('azure');
var notificationHubService =
azure.createNotificationHubService('hubname', 'connectionString');
notificationHubService.wns.sendToastText01(null,
{
text1: 'Hello from Node and Mobile Services!'
},
function (error)
{
if (!error) { // message sent successfully }
}
);
No need to store and maintain ChannelURIs.
Device registrations expire.
St. Louis Day of .NET 2013 - Delivering Push Notifications to Millions of Mobile Devices
App back-end
Tag:”Beatles”

Notification Hub

Tag:”Wailers”

Tag:”Beatles”
St. Louis Day of .NET 2013 - Delivering Push Notifications to Millions of Mobile Devices
St. Louis Day of .NET 2013 - Delivering Push Notifications to Millions of Mobile Devices
St. Louis Day of .NET 2013 - Delivering Push Notifications to Millions of Mobile Devices
Notification Hub
App back-end
// POST api/register
public async void Post(bool instId, bool channelUri, bool userId) {
// We assume a windows store app (if coding a multiplatform app, a ‘platform‘ parameter should be passed)
…
if (!authorizedToRegisterTag(userId))
{ throw new Exception("User not authorized to register"); }
var regsForInstId = await hubClient.GetRegistrationsByTag(instId, 100);
bool updated = false;
bool firstRegistration = true;
foreach (var registrationDescription in regsForInstId) {
if (firstRegistration) {
var winReg = registrationDescription as WindowsRegistrationDescription;
winReg.ChannelUri = new Uri(channelUri);
winReg.Tags.Clear();
winReg.Tags.UnionWith(new string[] {instId, userId});
hubClient.UpdateRegistration(winReg);
updated = true;
firstRegistration = false;
} else {
// if templates are not used, delete all extra registrations with this installation id.
hubClient.DeleteRegistration(registrationDescription);
}
}
// if not updated, a new registration has to be created for the device
if (!updated) {
hubClient.CreateWindowsNativeRegistration(channelUri, new string[] {instId, userId});
}
}
St. Louis Day of .NET 2013 - Delivering Push Notifications to Millions of Mobile Devices
St. Louis Day of .NET 2013 - Delivering Push Notifications to Millions of Mobile Devices
<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)”
}
}
St. Louis Day of .NET 2013 - Delivering Push Notifications to Millions of Mobile Devices
St. Louis Day of .NET 2013 - Delivering Push Notifications to Millions of Mobile Devices
St. Louis Day of .NET 2013 - Delivering Push Notifications to Millions of Mobile Devices
St. Louis Day of .NET 2013 - Delivering Push Notifications to Millions of Mobile Devices
St. Louis Day of .NET 2013 - Delivering Push Notifications to Millions of Mobile Devices
St. Louis Day of .NET 2013 - Delivering Push Notifications to Millions of Mobile Devices
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!
DVLUP – NOKIA’S REWARDS PROGRAM
COMPLETE APP CHALLENGES – EARN POINTS – GET COOL STUFF

Engage via
Gamification
& Rewards

Targeted &
Curated App
Challenges

Redeem earned
points for
Phones, Accessori
es, Dev Tools and
App Promotion

Over $5 million
worth of Rewards
and Campaigns

dvlup.com
Contact Me
adam grocholski

adgroc@microsoft.com
@codel8r
thinkfirstcodelater.com
St. Louis Day of .NET 2013 - Delivering Push Notifications to Millions of Mobile Devices

More Related Content

PDF
A Mock to far - GeeCon
ODP
Mock geecon2
PDF
Tilting at Windmills with ctypes and cygwinreg
DOCX
C++ file
PDF
Blending Culture in Twitter Client
PDF
C++ programs
PDF
Javascript 攻佔桌面應用程式:使用 electron
PDF
“iOS 11 в App in the Air”, Пронин Сергей, App in the Air
A Mock to far - GeeCon
Mock geecon2
Tilting at Windmills with ctypes and cygwinreg
C++ file
Blending Culture in Twitter Client
C++ programs
Javascript 攻佔桌面應用程式:使用 electron
“iOS 11 в App in the Air”, Пронин Сергей, App in the Air

What's hot (20)

TXT
c++ project on restaurant billing
DOCX
Pratik Bakane C++
PDF
VC「もしかして...」Model「私たち...」「「入れ替わってるー!?」」を前前前世から防ぐ方法
DOCX
Pratik Bakane C++
PPTX
(Rx).NET' way of async programming (.NET summit 2017 Belarus)
DOCX
Pratik Bakane C++
DOCX
Pratik Bakane C++
PPTX
Rx.NET, from the inside out - Codemotion 2018
DOCX
Travel management
PDF
描画とビジネスをクリーンに分ける(公開用)
PDF
wcmc_practicals
DOCX
Pratik Bakane C++
DOC
Telephone billing system in c++
DOCX
VISUALIZAR REGISTROS EN UN JTABLE
PDF
節子、それViewControllerやない...、FatViewControllerや...。
TXT
c++ program for Canteen management
PDF
Mirage For Beginners
DOCX
Student Data Base Using C/C++ Final Project
TXT
c++ program for Railway reservation
PDF
Introduction to Zend Framework web services
c++ project on restaurant billing
Pratik Bakane C++
VC「もしかして...」Model「私たち...」「「入れ替わってるー!?」」を前前前世から防ぐ方法
Pratik Bakane C++
(Rx).NET' way of async programming (.NET summit 2017 Belarus)
Pratik Bakane C++
Pratik Bakane C++
Rx.NET, from the inside out - Codemotion 2018
Travel management
描画とビジネスをクリーンに分ける(公開用)
wcmc_practicals
Pratik Bakane C++
Telephone billing system in c++
VISUALIZAR REGISTROS EN UN JTABLE
節子、それViewControllerやない...、FatViewControllerや...。
c++ program for Canteen management
Mirage For Beginners
Student Data Base Using C/C++ Final Project
c++ program for Railway reservation
Introduction to Zend Framework web services
Ad

Viewers also liked (8)

PPT
2010 Presentation
PPT
Nanotail Monitor Brintakis Linked In
PPTX
Final Presentation
PPTX
PPTX
St. Louis Day of .NET 2013 - Continuous Integration and Scripting with Window...
PPTX
St. Louis Day of .NET 2013 - Building Your Dev and Test Sandbox with Windows ...
PPTX
Google DevFest MN - Windows Azure Notification Hubs
PPTX
Mobile March Windows Azure Notification Hubs
2010 Presentation
Nanotail Monitor Brintakis Linked In
Final Presentation
St. Louis Day of .NET 2013 - Continuous Integration and Scripting with Window...
St. Louis Day of .NET 2013 - Building Your Dev and Test Sandbox with Windows ...
Google DevFest MN - Windows Azure Notification Hubs
Mobile March Windows Azure Notification Hubs
Ad

Similar to St. Louis Day of .NET 2013 - Delivering Push Notifications to Millions of Mobile Devices (20)

PPTX
Azure notification hubs
PDF
Cross Platform Mobile Push Notifications with Azure Notifications Hub
PPTX
Net campus15 notification-hub
PPTX
AZURE NOTIFICATION HUB
PPTX
Push_notifikacije_na_Azureu[1]
PPTX
Azure Notification hub
PPTX
Delivering Millions of Push Notifications in Minutes
PDF
Get step-by-step instructions on implementing notifications in your apps.
PPTX
Scaling push notifications to millions of devices using notification hubs
PDF
08.Push Notifications
PDF
Push to Me: Mobile Push Notifications (Zend Framework)
PDF
Petr Dvořák: Push notifikace ve velkém
PPTX
In the Clouds with Windows Phone 7
PDF
In the hunt of 100% delivery rate with mobile push notifications
PDF
Leveraging Zend Framework for Sending Push Notifications
PPTX
11 background tasks and multitasking
PDF
follow-app BOOTCAMP 2 - Windows Phone: Tiles and Notifications
PDF
Zend Framework Push Notifications
PDF
Mobile Push Notifications
PDF
How to Enable Unified Push Notifications in Native and HTML5 Hybrid Mobile Apps
Azure notification hubs
Cross Platform Mobile Push Notifications with Azure Notifications Hub
Net campus15 notification-hub
AZURE NOTIFICATION HUB
Push_notifikacije_na_Azureu[1]
Azure Notification hub
Delivering Millions of Push Notifications in Minutes
Get step-by-step instructions on implementing notifications in your apps.
Scaling push notifications to millions of devices using notification hubs
08.Push Notifications
Push to Me: Mobile Push Notifications (Zend Framework)
Petr Dvořák: Push notifikace ve velkém
In the Clouds with Windows Phone 7
In the hunt of 100% delivery rate with mobile push notifications
Leveraging Zend Framework for Sending Push Notifications
11 background tasks and multitasking
follow-app BOOTCAMP 2 - Windows Phone: Tiles and Notifications
Zend Framework Push Notifications
Mobile Push Notifications
How to Enable Unified Push Notifications in Native and HTML5 Hybrid Mobile Apps

Recently uploaded (20)

PDF
TrustArc Webinar - Click, Consent, Trust: Winning the Privacy Game
PDF
Web App vs Mobile App What Should You Build First.pdf
PPT
What is a Computer? Input Devices /output devices
PPT
Module 1.ppt Iot fundamentals and Architecture
PDF
ENT215_Completing-a-large-scale-migration-and-modernization-with-AWS.pdf
PDF
2021 HotChips TSMC Packaging Technologies for Chiplets and 3D_0819 publish_pu...
PDF
Assigned Numbers - 2025 - Bluetooth® Document
PDF
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
PDF
Enhancing emotion recognition model for a student engagement use case through...
PPTX
OMC Textile Division Presentation 2021.pptx
PPTX
O2C Customer Invoices to Receipt V15A.pptx
PDF
Hybrid model detection and classification of lung cancer
PPTX
1. Introduction to Computer Programming.pptx
PPTX
Final SEM Unit 1 for mit wpu at pune .pptx
PDF
Developing a website for English-speaking practice to English as a foreign la...
PDF
Hindi spoken digit analysis for native and non-native speakers
PDF
1 - Historical Antecedents, Social Consideration.pdf
PDF
From MVP to Full-Scale Product A Startup’s Software Journey.pdf
PPTX
TLE Review Electricity (Electricity).pptx
PDF
Getting started with AI Agents and Multi-Agent Systems
TrustArc Webinar - Click, Consent, Trust: Winning the Privacy Game
Web App vs Mobile App What Should You Build First.pdf
What is a Computer? Input Devices /output devices
Module 1.ppt Iot fundamentals and Architecture
ENT215_Completing-a-large-scale-migration-and-modernization-with-AWS.pdf
2021 HotChips TSMC Packaging Technologies for Chiplets and 3D_0819 publish_pu...
Assigned Numbers - 2025 - Bluetooth® Document
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
Enhancing emotion recognition model for a student engagement use case through...
OMC Textile Division Presentation 2021.pptx
O2C Customer Invoices to Receipt V15A.pptx
Hybrid model detection and classification of lung cancer
1. Introduction to Computer Programming.pptx
Final SEM Unit 1 for mit wpu at pune .pptx
Developing a website for English-speaking practice to English as a foreign la...
Hindi spoken digit analysis for native and non-native speakers
1 - Historical Antecedents, Social Consideration.pdf
From MVP to Full-Scale Product A Startup’s Software Journey.pdf
TLE Review Electricity (Electricity).pptx
Getting started with AI Agents and Multi-Agent Systems

St. Louis Day of .NET 2013 - Delivering Push Notifications to Millions of Mobile Devices

Editor's Notes

  • #42: Now, let us take a look at developers. Our whole strategy for developers is based on making them successful in the app economy. We need to invest today in our developer’s success to ensure a steady flow of apps, that will sell tomorrow’s devices. We recently announced a new initiative that helps developers succeed. It is called DVLUP.DVLUP brings together proven models of gamification and a rewards system (similar to frequent flyer programs in the airline industry) to encourage developers to engage with a development platform.In DVLUP, developers earn points while developing apps for targeted and curated app challenges.  This approach enables us to gain new developers, incentivize them to create apps that are relevant to the consumer and at the same time offer ways for developers to become successful, by supporting them in promoting and marketing their apps to a global audiance. We have launched DVLUP in 21 countries, And we are offering over $5 million worth of rewards to our developers.- Go to www.dvlup.com to find out more