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

Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
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
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsRoshan Dwivedi
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...gurkirankumar98700
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024The Digital Insurer
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 

Último (20)

Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
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...
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 

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.