SlideShare ist ein Scribd-Unternehmen logo
1 von 25
Downloaden Sie, um offline zu lesen
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!

Weitere ähnliche Inhalte

Mehr von 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
 

Mehr von 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
 

Kürzlich hochgeladen

Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsMiki Katsuragi
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxNavinnSomaal
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clashcharlottematthew16
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostZilliz
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionDilum Bandara
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteDianaGray10
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxhariprasad279825
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .Alan Dix
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 

Kürzlich hochgeladen (20)

Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering Tips
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptx
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clash
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An Introduction
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test Suite
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptx
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 

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.