SlideShare uma empresa Scribd logo
1 de 25
Baixar para ler offline
Cross platform development with
Azure Mobile Services
Ibon Landa
Plain Concepts


Mobile Platforms
iOS
Objective C
Xcode
Windows Phone
C#/Visual
Basic/F#
Visual Studio
Android
Java
Eclipse
IntelliJ
What is Mobile Services?
The REST API
Action HTTP Verb URL Suffix
Create POST /TodoItem
Read GET /TodoItem?$filter=id%3D42
Update PATCH /TodoItem/id
Delete DELETE /TodoItem/id
https://Mobileservice.azure-mobile.net/tables/*
Mobile Services Tiers
General Availability
99.9%
Free Standard Premium
Usage
Restrictions
Up to 10 services,
Up to 500 Active Devices*
N/A N/A
API Calls 500K
(per subscription)
1.5M
(per unit)
15M
(per unit)
Scale N/A Up to 6
Standard units
Up to 10
Enterprise units
Scheduled Jobs Limited Included Included
SQL Database
(required)
20MB Included,
Standard rates apply
for more capacity
20MB Included,
Standard rates apply
for more capacity
20MB Included,
Standard rates apply
for more capacity
Mobile push is everywhere
Reservation changes, Deals, Back-
office
Travel/Hospitality/Airlines
SMS replacement, Deals, Back-
office
Banking/Insurance
Orders, Product UX,
Back-office
Discrete manufacturing/Auto
Prescriptions, Appointments,
LOB (maintenance)
Healthcare
Breaking news
News/Media
Offers, Orders, Back-office
Retail
Registration at app launch
1. Client app contacts Platform Notification Service, to retrieve
current channel (e.g. ChannelURIs, device tokens,
registrationIds)
2. App updates handle in back-end
Sending Notification
1. App back-end send notification to PNS
2. PNS pushes the notification to the app on the device
Maintenance
1. Delete expired handles when PNS rejects them
Push notification lifecycle
Platform
Notification
Service
App back-end
Platform dependency
Different communication protocols to PNS’ (e.g. HTTP vs TCP, xml payload vs json payload)
Different presentation formats and capabilities (tiles vs toasts vs badges)
Routing
PNS’ provide a way to send a message to a device/channel
Usually notifications are targeted at users or interest groups (e.g. employees assigned to a customer account)
App back-end has to maintain a registry associating device handles to interest groups/users
Scale
App back-end has to store current handles for each device  high storage and VM costs
Broadcast to millions of devices with low latency requires parallelization (DB ad VM)
Challenges of push notifications
One-time set up
1. Create a Notification Hub
Register
1. The client app retrieves its current handle from the PNS
2. Client app creates (or updates) a registration on the
Notification Hub with the current handle
Send Notification
1. The app back-end sends a message to the Notification Hub
2. Notification Hub pushes it to the PNS’
Using Notification Hubs
APNsWNS
Notification Hub
App back-end
iOS app Windows app
MPNS
GCM
ADM
X-plat: from any back-end to any mobile platform
Backend can be on-prem or in the cloud, .NET/Node/Java/PHP/Node/anything.
Support Windows Phone/Windows/iOS/Android and (as of today) Kindle Fire.
No need to store device information in the app back-end
Notification Hub maintains the registry of devices and the associations to users/interest groups
Routing and interest groups
Target individual users and large interest groups using tags
Personalization and localization
Keep your back-end free of presentation concerns like localization and user preferences using templates
Broadcast at scale, multicast, unicast
Push notifications to millions of devices (across platforms) with a single call
Telemetry
Advantages of using Notification Hubs
Bing (news, finance, sports, …) Sochi 2014
Case studies
10s
3+ <2
100s
3+ 150+
Register Send
Some snippets
await
[hub registerNativeWithDeviceToken:deviceToken
tags:nil
completion:^(NSError* error) { … }];
hub.register(regid);
var toast = @“<notification payload>";
hub.SendWindowsNativeNotificationAsync(toast);
hubService.wns.sendToastText01(null,
{
text1: 'Hello from Node!'
},
function (error)
{
…
}
);
Tags as interest groups
1. Client app can register with a set of tags
2. Tags are simple strings (no pre-provisioning is required)
3. App back-end can target all clients with the same tag
You can use tags also for
Multiple type of interest groups, e.g.
Follow bands: tag “followband:Beatles”
Follow users: tag “followuser:Alice”
Tag devices with a user id
Tags
Notification Hub
App back-end
Tag:”Beatles”Tag:”Wailers”
Tag:”Beatles”
Register
Some snippets
await new string[] {"myTag", "myOtherTag"}
[hub registerNativeWithDeviceToken:deviceToken tags:@[@"myTag", @"myOtherTag"] completion:
^(NSError* error) {
…
}];
hub.register(regid, "myTag“, "myOtherTag");
Notification Hubs is not a storage system
Maintain an authoritative store for your tags
In the device
Every platform provides apps a way to store user information locally or in the
cloud
E.g. Roaming settings, iCloud
In your app back-end
Usually stored by user
Try not to replicate device information
Register methods always overwrite tags
Each time you update the channel, overwrite all the tags
“How do I read tags from my hub?”
Registration
Client apps can register with a platform specific template, e.g.
Windows tablet registers with Windows Store ToastText01 template
iPhone with the Apple JSON template:
{ aps: {alert: “$(message)”}}
Send notification
App back-end sends a platform independent message: {message: “Hello!”}
Notes
Multiple templates can be specified for each device
Each template can have a different set of tags
Using templates for multi-platform push
Notification Hub
App back-end
<toast>
<visual>
<binding template="ToastText01">
<text id="1">$(message)</text>
</binding>
</visual>
</toast>
{
aps: {
alert: “$(message)”
}
}
{
message: “Hello!”
}
Hello!
Hello!
Registration
Client apps can register with personalized templates, e.g.
Windows tablet wants to receive news in English
iPhone wants Italian
Send notification
App back-end sends a message including both languages: {news_en: “Hello!”, news_it: “Ciao!”}
Template Expressions
Templates support a simple expression language:
E.g. {‘Elio, ’+$(friend)+’ added you to ’+$(groupName)}
Using templates for localization
Notification Hub
App back-end
<toast>
<visual>
<binding template="ToastText01">
<text id="1">$(news_en)</text>
</binding>
</visual>
</toast>
{
aps: {
alert: “$(news_it)”
}
}
{
news_en: “Hello!”,
news_it: “Ciao!”
}
Hello!
Ciao!
Thanks!

Mais conteúdo relacionado

Mais de Ibon Landa

Aprovisionamiento y configuración deVMs con Azure Resource Manager
Aprovisionamiento y configuración deVMs con Azure Resource ManagerAprovisionamiento y configuración deVMs con Azure Resource Manager
Aprovisionamiento y configuración deVMs con Azure Resource ManagerIbon Landa
 
Building real world cloud apps with azure
Building real world cloud apps with azureBuilding real world cloud apps with azure
Building real world cloud apps with azureIbon Landa
 
Open source and cross platform .net
Open source and cross platform .netOpen source and cross platform .net
Open source and cross platform .netIbon Landa
 
Cross platform mobile development with visual studio and xamarin
Cross platform mobile development with visual studio and xamarinCross platform mobile development with visual studio and xamarin
Cross platform mobile development with visual studio and xamarinIbon Landa
 
Dev ops: Continuous delivery and Windows Azure
Dev ops: Continuous delivery and Windows AzureDev ops: Continuous delivery and Windows Azure
Dev ops: Continuous delivery and Windows AzureIbon Landa
 
Gestión de identidad en aplicaciones corporativas web y móvil
Gestión de identidad en aplicaciones corporativas web y móvilGestión de identidad en aplicaciones corporativas web y móvil
Gestión de identidad en aplicaciones corporativas web y móvilIbon Landa
 
Arquitectura y Buenas prácticas con Windows Azure para ITPros
Arquitectura y Buenas prácticas con Windows Azure para ITProsArquitectura y Buenas prácticas con Windows Azure para ITPros
Arquitectura y Buenas prácticas con Windows Azure para ITProsIbon Landa
 
Arquitecturas y posicionamientos tecnológicos
Arquitecturas y posicionamientos tecnológicosArquitecturas y posicionamientos tecnológicos
Arquitecturas y posicionamientos tecnológicosIbon Landa
 
Gestión de identidad en Cloud
Gestión de identidad en CloudGestión de identidad en Cloud
Gestión de identidad en CloudIbon Landa
 
Scrum en equipos multiproyectos
Scrum en equipos multiproyectosScrum en equipos multiproyectos
Scrum en equipos multiproyectosIbon Landa
 
Montando un escenario de integración continua - Pucela Tech Day
Montando un escenario de integración continua - Pucela Tech DayMontando un escenario de integración continua - Pucela Tech Day
Montando un escenario de integración continua - Pucela Tech DayIbon Landa
 
Windows azure connect copy
Windows azure connect   copyWindows azure connect   copy
Windows azure connect copyIbon Landa
 
Windows Azure Connect
Windows Azure ConnectWindows Azure Connect
Windows Azure ConnectIbon Landa
 
Integración de Team Foundation Server con Project Server
Integración de Team Foundation Server con Project ServerIntegración de Team Foundation Server con Project Server
Integración de Team Foundation Server con Project ServerIbon Landa
 

Mais de Ibon Landa (14)

Aprovisionamiento y configuración deVMs con Azure Resource Manager
Aprovisionamiento y configuración deVMs con Azure Resource ManagerAprovisionamiento y configuración deVMs con Azure Resource Manager
Aprovisionamiento y configuración deVMs con Azure Resource Manager
 
Building real world cloud apps with azure
Building real world cloud apps with azureBuilding real world cloud apps with azure
Building real world cloud apps with azure
 
Open source and cross platform .net
Open source and cross platform .netOpen source and cross platform .net
Open source and cross platform .net
 
Cross platform mobile development with visual studio and xamarin
Cross platform mobile development with visual studio and xamarinCross platform mobile development with visual studio and xamarin
Cross platform mobile development with visual studio and xamarin
 
Dev ops: Continuous delivery and Windows Azure
Dev ops: Continuous delivery and Windows AzureDev ops: Continuous delivery and Windows Azure
Dev ops: Continuous delivery and Windows Azure
 
Gestión de identidad en aplicaciones corporativas web y móvil
Gestión de identidad en aplicaciones corporativas web y móvilGestión de identidad en aplicaciones corporativas web y móvil
Gestión de identidad en aplicaciones corporativas web y móvil
 
Arquitectura y Buenas prácticas con Windows Azure para ITPros
Arquitectura y Buenas prácticas con Windows Azure para ITProsArquitectura y Buenas prácticas con Windows Azure para ITPros
Arquitectura y Buenas prácticas con Windows Azure para ITPros
 
Arquitecturas y posicionamientos tecnológicos
Arquitecturas y posicionamientos tecnológicosArquitecturas y posicionamientos tecnológicos
Arquitecturas y posicionamientos tecnológicos
 
Gestión de identidad en Cloud
Gestión de identidad en CloudGestión de identidad en Cloud
Gestión de identidad en Cloud
 
Scrum en equipos multiproyectos
Scrum en equipos multiproyectosScrum en equipos multiproyectos
Scrum en equipos multiproyectos
 
Montando un escenario de integración continua - Pucela Tech Day
Montando un escenario de integración continua - Pucela Tech DayMontando un escenario de integración continua - Pucela Tech Day
Montando un escenario de integración continua - Pucela Tech Day
 
Windows azure connect copy
Windows azure connect   copyWindows azure connect   copy
Windows azure connect copy
 
Windows Azure Connect
Windows Azure ConnectWindows Azure Connect
Windows Azure Connect
 
Integración de Team Foundation Server con Project Server
Integración de Team Foundation Server con Project ServerIntegración de Team Foundation Server con Project Server
Integración de Team Foundation Server con Project Server
 

Último

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
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesrafiqahmad00786416
 
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
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyKhushali Kathiriya
 
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
 
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityWSO2
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDropbox
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistandanishmna97
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...apidays
 
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
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Jeffrey Haguewood
 
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
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MIND CTI
 
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Bhuvaneswari Subramani
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdfSandro Moreira
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Angeliki Cooney
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Orbitshub
 
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
 

Último (20)

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
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
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
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
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
 
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital Adaptability
 
+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...
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
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
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
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
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 
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...
 

Cross platform development with azure mobile services

  • 1. Cross platform development with Azure Mobile Services Ibon Landa Plain Concepts
  • 2.
  • 3.
  • 5. Mobile Platforms iOS Objective C Xcode Windows Phone C#/Visual Basic/F# Visual Studio Android Java Eclipse IntelliJ
  • 6.
  • 7. What is Mobile Services?
  • 8.
  • 9. The REST API Action HTTP Verb URL Suffix Create POST /TodoItem Read GET /TodoItem?$filter=id%3D42 Update PATCH /TodoItem/id Delete DELETE /TodoItem/id https://Mobileservice.azure-mobile.net/tables/*
  • 10. Mobile Services Tiers General Availability 99.9% Free Standard Premium Usage Restrictions Up to 10 services, Up to 500 Active Devices* N/A N/A API Calls 500K (per subscription) 1.5M (per unit) 15M (per unit) Scale N/A Up to 6 Standard units Up to 10 Enterprise units Scheduled Jobs Limited Included Included SQL Database (required) 20MB Included, Standard rates apply for more capacity 20MB Included, Standard rates apply for more capacity 20MB Included, Standard rates apply for more capacity
  • 11.
  • 12. Mobile push is everywhere Reservation changes, Deals, Back- office Travel/Hospitality/Airlines SMS replacement, Deals, Back- office Banking/Insurance Orders, Product UX, Back-office Discrete manufacturing/Auto Prescriptions, Appointments, LOB (maintenance) Healthcare Breaking news News/Media Offers, Orders, Back-office Retail
  • 13. Registration at app launch 1. Client app contacts Platform Notification Service, to retrieve current channel (e.g. ChannelURIs, device tokens, registrationIds) 2. App updates handle in back-end Sending Notification 1. App back-end send notification to PNS 2. PNS pushes the notification to the app on the device Maintenance 1. Delete expired handles when PNS rejects them Push notification lifecycle Platform Notification Service App back-end
  • 14. Platform dependency Different communication protocols to PNS’ (e.g. HTTP vs TCP, xml payload vs json payload) Different presentation formats and capabilities (tiles vs toasts vs badges) Routing PNS’ provide a way to send a message to a device/channel Usually notifications are targeted at users or interest groups (e.g. employees assigned to a customer account) App back-end has to maintain a registry associating device handles to interest groups/users Scale App back-end has to store current handles for each device  high storage and VM costs Broadcast to millions of devices with low latency requires parallelization (DB ad VM) Challenges of push notifications
  • 15. One-time set up 1. Create a Notification Hub Register 1. The client app retrieves its current handle from the PNS 2. Client app creates (or updates) a registration on the Notification Hub with the current handle Send Notification 1. The app back-end sends a message to the Notification Hub 2. Notification Hub pushes it to the PNS’ Using Notification Hubs APNsWNS Notification Hub App back-end iOS app Windows app MPNS GCM ADM
  • 16. X-plat: from any back-end to any mobile platform Backend can be on-prem or in the cloud, .NET/Node/Java/PHP/Node/anything. Support Windows Phone/Windows/iOS/Android and (as of today) Kindle Fire. No need to store device information in the app back-end Notification Hub maintains the registry of devices and the associations to users/interest groups Routing and interest groups Target individual users and large interest groups using tags Personalization and localization Keep your back-end free of presentation concerns like localization and user preferences using templates Broadcast at scale, multicast, unicast Push notifications to millions of devices (across platforms) with a single call Telemetry Advantages of using Notification Hubs
  • 17. Bing (news, finance, sports, …) Sochi 2014 Case studies 10s 3+ <2 100s 3+ 150+
  • 18. Register Send Some snippets await [hub registerNativeWithDeviceToken:deviceToken tags:nil completion:^(NSError* error) { … }]; hub.register(regid); var toast = @“<notification payload>"; hub.SendWindowsNativeNotificationAsync(toast); hubService.wns.sendToastText01(null, { text1: 'Hello from Node!' }, function (error) { … } );
  • 19. Tags as interest groups 1. Client app can register with a set of tags 2. Tags are simple strings (no pre-provisioning is required) 3. App back-end can target all clients with the same tag You can use tags also for Multiple type of interest groups, e.g. Follow bands: tag “followband:Beatles” Follow users: tag “followuser:Alice” Tag devices with a user id Tags Notification Hub App back-end Tag:”Beatles”Tag:”Wailers” Tag:”Beatles”
  • 20. Register Some snippets await new string[] {"myTag", "myOtherTag"} [hub registerNativeWithDeviceToken:deviceToken tags:@[@"myTag", @"myOtherTag"] completion: ^(NSError* error) { … }]; hub.register(regid, "myTag“, "myOtherTag");
  • 21. Notification Hubs is not a storage system Maintain an authoritative store for your tags In the device Every platform provides apps a way to store user information locally or in the cloud E.g. Roaming settings, iCloud In your app back-end Usually stored by user Try not to replicate device information Register methods always overwrite tags Each time you update the channel, overwrite all the tags “How do I read tags from my hub?”
  • 22. Registration Client apps can register with a platform specific template, e.g. Windows tablet registers with Windows Store ToastText01 template iPhone with the Apple JSON template: { aps: {alert: “$(message)”}} Send notification App back-end sends a platform independent message: {message: “Hello!”} Notes Multiple templates can be specified for each device Each template can have a different set of tags Using templates for multi-platform push Notification Hub App back-end <toast> <visual> <binding template="ToastText01"> <text id="1">$(message)</text> </binding> </visual> </toast> { aps: { alert: “$(message)” } } { message: “Hello!” } Hello! Hello!
  • 23. Registration Client apps can register with personalized templates, e.g. Windows tablet wants to receive news in English iPhone wants Italian Send notification App back-end sends a message including both languages: {news_en: “Hello!”, news_it: “Ciao!”} Template Expressions Templates support a simple expression language: E.g. {‘Elio, ’+$(friend)+’ added you to ’+$(groupName)} Using templates for localization Notification Hub App back-end <toast> <visual> <binding template="ToastText01"> <text id="1">$(news_en)</text> </binding> </visual> </toast> { aps: { alert: “$(news_it)” } } { news_en: “Hello!”, news_it: “Ciao!” } Hello! Ciao!
  • 24.