SlideShare a Scribd company logo
Sending Cross Platform Notifications
using Azure Notifications Hub &
Xamarin
Anubhav Ranjan
Consultant at Xamarin,
Microsoft MVP
@anubhavr05
Sukriti Sharma
Technical Evangelist
@suksharma
Agenda
• Push Notifications
• Notification Hub
• Tags: Send Targeted Notifications
• Templates
Push Notifications are BIG
Push notification lifecycle
Registration at app launch
1. Client app to retrieve PNS Handle (e.g. Channel Uris,
device tokens, registration IDs)
2. Updates back-end
Sending Notification
1. Back-end sends notification to PNS
2. PNS pushes the notification to the app on the device
Maintenance
1. Delete expired handles when PNS rejects them
Platform
Notification
Service
App back-end
Challenges of push notifications
• Different protocols to PNS’ (e.g. HTTP vs TCP, xml payload vs json
payload)
• Tiles vs toasts vs badges
• Maintaining ChannelURI/ RegistrationID/ Token provided by PNS
• Back-end complications (Storage) and Cost
• Scalability
Azure Notification Hubs (advantages)
• X-plat: from any back-end to any mobile platform
• No need to store device information in the app back-end (managed)
• Routing and interest groups
• Personalization and localization
• Broadcast at scale, multicast, unicast
• Telemetry
Using Notification Hubs
One-time set up
1. Create NH
Register (Client)
1. Retrieve PNS Handle
2. Register with NH using PNS Handle
Send Notification
1. Back-end sends message to NH
2. NH pushes it to the PNS’
*PNS – Platform Notification Service
*NH – Notifications Hub
APNsWNS
Notification Hub
App back-end
iOS app Windows app
MPNS
GCM
ADM
•Client SDKs for
• Android – GCM and ADM
• iOS – APNS
• Windows Phone – MPNS
• Windows Store – WNS
•Capable of pushing to specific platform or to all at once
•Server SDKs for
• REST API
• .NET
• Node.JS
• Java
Cross-Platform Push
Some snippets
Register Send
await
[hub
registerNativeWithDeviceToken:deviceToken
tags:nil
completion:^(NSError* error) {…}];
hub.register(regid);
var toast = @“<notification payload>";
hub.SendWindowsNativeNotificationAsync(toas
t);
hubService.wns.sendToastText01(null,
{
text1: 'Hello from Node!'
},
function (error)
{
…
}
);
Send Targeted Notifications
Tags
Tags as interest groups
1. Client app registers with tags
2. Tags are simple strings (no pre-provisioning is required)
3. Back-end can target all clients with the same tag
You can use tags also for
• Multiple type of interest groups, e.g.
• Follow movie stars: tag “followactor:Rajnikant”
• Follow users: tag “followuser:SachinTendulkar”
• Tags can be user preferences or system information
Notification Hub
App back-end
Tag:”Rajnikant”Tag:”Salman”
Tag:”Rajnikant”
Tags: Example
• Logic based tag pushed
• Social: “All of this group but me”
• Group:id && !user:id
• Events: “Anyone interested in the game”
• FollowTeam:RealMadrid || FollowTeam:Barcelona || EventInterest:LaLiga
• Time: “@12PM in India send”
• timezone:IST && follows:chinesefood
Tag Expressions
Some snippets
Register
await new string[] {"myTag", "myOtherTag"}
[hub registerNativeWithDeviceToken:deviceToken tags:@[@"myTag", @"myOtherTag"] completion:
^(NSError* error) {
…
}];
hub.register(regid, "myTag“, "myOtherTag");
Demo: Get Started
- Portal Demo
- Google Console
- Configure your Notification Hub
- Connecting your app to the Notification Hub
- Send notifications from your back-end
- Register with Tags
Notification Templates
Using templates for multi-platform push
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
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!
Using templates for localization
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!”}
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!
Sending geo-targeted notifications with
Windows Azure Notification Hubs
Some examples are:
• Send coupons to all my customers in Mumbai
• Send notifications of new mortgage rates/open houses in a
specific locality
• Notify people in a town/city about a concert they might be
interested in
• Notify people in a town/city of a charity/recycling event
“How do I read tags from my hub?”
• Notification Hubs is not a storage system
• No cleanup needed, expires registrations automatically
• 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 id
• Try not to replicate device information
• Register methods always overwrite tags
• Each time you update the channel, overwrite all the tags
Managing devices from your back-end
When to register from your app back-end
• To secure Tags
• App back-end can authenticate the user before registering the device
• When back-end has to modify tags
• Adding a tag from the web app
• Manager adding an employee to a work group
• Tags are derived from analytics or other user data
Registering from the back-end
Identify your device
1. Cannot use ChannelURIs/device tokens/…
2. Keep long-living NH registration ids in device storage
Register
1. First time only,
a) Request registration id from hub, and
b) Store it on device storage
2. CreateOrUpdate device registration (@ every app start)
3. Back-end can verify and/or add tags (e.g. performing auth)
Notification Hub
App back-end
{id}
upsert({id}, channel, tags)
createId()
Managing devices from your back-end
Back-end driven tag updates
Use a tag to identify user
1. Back-end usually refers to users and not devices
2. Register devices with a tag like ‘userid:{id}’
Back-end updates tags
1. Retrieve device registration(s) by userid
2. Update tags
Note
1. No device information in app back-end
2. Back-end only refers to users
Notification Hub
App back-end
getByTag(userid)
update(tags)
Managing devices from your back-end
Advanced scenarios: “Push to Sync”, Retargeting
Push to Sync
Updates app state
1. Does not show a message to the user
Example: music app
1. User changes playlist on desktop
2. Back-end sends a ‘push-to-sync’ notifications to user’s devices
3. Phone receives push and starts downloading new song
4. User finds the new song already on their phone!
Platform-dependent
Windows/Windows Phone (only lock-screen apps)
iOS (only since iOS 7)
Android/Kindle
App back-end
Notification Hub
Push to sync
Add new song
Pulling it all together - Retargeting
Send a targeted coupon
1. Use tags for user preferences, location, system properties,
timezone, …
2. Target with tag expressions
Push UX & feedback
1. Use Rich push & push to sync to provide best UX
2. Contextually report to your app back-end
(who tapped, who visited the page, who received it)
Retarget
1. (perform analysis on user data)
2. Update tags from your back-end with the new information
3. Send alternative offer to users that did not participate
App back-end
Notification Hub
Loc:SF && Food
Update tags
Loc:SF && Food
&& !tapped
CRM/DMP
system
Follow us online
Facebook
facebook.com/MicrosoftDeveloper.India
twitter.com/msdevindia
Twitter
@anubhavr05
@suksharma
Cross Platform Mobile Push Notifications with Azure Notifications Hub

More Related Content

What's hot

Improve Monitoring & Monetization of Your Mobile Apps
Improve Monitoring & Monetization of Your Mobile AppsImprove Monitoring & Monetization of Your Mobile Apps
Improve Monitoring & Monetization of Your Mobile Apps
Amazon Web Services
 
ShepHertz Cloud Ecosystem for Apps
ShepHertz Cloud Ecosystem for AppsShepHertz Cloud Ecosystem for Apps
ShepHertz Cloud Ecosystem for Apps
ShepHertz
 
Azetone 2018 UX Analytics, A/B Testing & Personalization
Azetone 2018 UX Analytics, A/B Testing & PersonalizationAzetone 2018 UX Analytics, A/B Testing & Personalization
Azetone 2018 UX Analytics, A/B Testing & Personalization
Philippe Dumont
 
Google Mobile App Analytics - 2015
Google Mobile App Analytics - 2015Google Mobile App Analytics - 2015
Google Mobile App Analytics - 2015
Jaap Willem van de Plasse
 
Journey Through the Cloud - Mobile & Social Apps
Journey Through the Cloud - Mobile & Social AppsJourney Through the Cloud - Mobile & Social Apps
Journey Through the Cloud - Mobile & Social Apps
Amazon Web Services
 
Proximity marketing for supermarkets
Proximity marketing for supermarketsProximity marketing for supermarkets
Proximity marketing for supermarkets
Leantegra
 
AWS Mobile Services: Amazon Cognito - Identity Broker and Synchronization Ser...
AWS Mobile Services: Amazon Cognito - Identity Broker and Synchronization Ser...AWS Mobile Services: Amazon Cognito - Identity Broker and Synchronization Ser...
AWS Mobile Services: Amazon Cognito - Identity Broker and Synchronization Ser...Amazon Web Services
 
Google Analytic for Mobile Applications
Google Analytic for Mobile ApplicationsGoogle Analytic for Mobile Applications
Google Analytic for Mobile Applications
Rajith Rajan
 
Startup Analytics
Startup Analytics Startup Analytics
Startup Analytics
Resad Zacina
 
Amazon Pinpoint - DevDay Austin 2017
Amazon Pinpoint - DevDay Austin 2017Amazon Pinpoint - DevDay Austin 2017
Amazon Pinpoint - DevDay Austin 2017Amazon Web Services
 
Build Your Mobile App Faster with AWS Mobile Services
Build Your Mobile App Faster with AWS Mobile ServicesBuild Your Mobile App Faster with AWS Mobile Services
Build Your Mobile App Faster with AWS Mobile Services
Amazon Web Services
 
RTLS, Indoor Navigation & Proximity Marketing for Airports
RTLS, Indoor Navigation & Proximity Marketing for AirportsRTLS, Indoor Navigation & Proximity Marketing for Airports
RTLS, Indoor Navigation & Proximity Marketing for Airports
Leantegra
 
Mobile Analytics 101
Mobile Analytics 101Mobile Analytics 101
Mobile Analytics 101
Murat Can Demir
 
Azetone: Mobile A/B Testing & Personalization
Azetone: Mobile A/B Testing & Personalization Azetone: Mobile A/B Testing & Personalization
Azetone: Mobile A/B Testing & Personalization
Philippe Dumont
 
Google Mobile App Analytics
Google Mobile App AnalyticsGoogle Mobile App Analytics
Google Mobile App Analytics
Belmond Victor
 
02 cloud poweredmobileappsonaws_short
02 cloud poweredmobileappsonaws_short02 cloud poweredmobileappsonaws_short
02 cloud poweredmobileappsonaws_shortCodemotion
 
PhoneGap Enterprise Viewer by Anthony Rumsey
PhoneGap Enterprise Viewer by Anthony RumseyPhoneGap Enterprise Viewer by Anthony Rumsey
PhoneGap Enterprise Viewer by Anthony Rumsey
AEM HUB
 
Has offers 'global insights performance marketing' presentation 2015 - shared
Has offers 'global insights   performance marketing' presentation 2015 - sharedHas offers 'global insights   performance marketing' presentation 2015 - shared
Has offers 'global insights performance marketing' presentation 2015 - shared
David Burke
 
Azure Mobile Services
Azure Mobile ServicesAzure Mobile Services
Azure Mobile Services
fatih demir
 
AWS Cloud Kata 2014 | Jakarta - 2-2 Mobile
AWS Cloud Kata 2014 | Jakarta - 2-2 MobileAWS Cloud Kata 2014 | Jakarta - 2-2 Mobile
AWS Cloud Kata 2014 | Jakarta - 2-2 Mobile
Amazon Web Services
 

What's hot (20)

Improve Monitoring & Monetization of Your Mobile Apps
Improve Monitoring & Monetization of Your Mobile AppsImprove Monitoring & Monetization of Your Mobile Apps
Improve Monitoring & Monetization of Your Mobile Apps
 
ShepHertz Cloud Ecosystem for Apps
ShepHertz Cloud Ecosystem for AppsShepHertz Cloud Ecosystem for Apps
ShepHertz Cloud Ecosystem for Apps
 
Azetone 2018 UX Analytics, A/B Testing & Personalization
Azetone 2018 UX Analytics, A/B Testing & PersonalizationAzetone 2018 UX Analytics, A/B Testing & Personalization
Azetone 2018 UX Analytics, A/B Testing & Personalization
 
Google Mobile App Analytics - 2015
Google Mobile App Analytics - 2015Google Mobile App Analytics - 2015
Google Mobile App Analytics - 2015
 
Journey Through the Cloud - Mobile & Social Apps
Journey Through the Cloud - Mobile & Social AppsJourney Through the Cloud - Mobile & Social Apps
Journey Through the Cloud - Mobile & Social Apps
 
Proximity marketing for supermarkets
Proximity marketing for supermarketsProximity marketing for supermarkets
Proximity marketing for supermarkets
 
AWS Mobile Services: Amazon Cognito - Identity Broker and Synchronization Ser...
AWS Mobile Services: Amazon Cognito - Identity Broker and Synchronization Ser...AWS Mobile Services: Amazon Cognito - Identity Broker and Synchronization Ser...
AWS Mobile Services: Amazon Cognito - Identity Broker and Synchronization Ser...
 
Google Analytic for Mobile Applications
Google Analytic for Mobile ApplicationsGoogle Analytic for Mobile Applications
Google Analytic for Mobile Applications
 
Startup Analytics
Startup Analytics Startup Analytics
Startup Analytics
 
Amazon Pinpoint - DevDay Austin 2017
Amazon Pinpoint - DevDay Austin 2017Amazon Pinpoint - DevDay Austin 2017
Amazon Pinpoint - DevDay Austin 2017
 
Build Your Mobile App Faster with AWS Mobile Services
Build Your Mobile App Faster with AWS Mobile ServicesBuild Your Mobile App Faster with AWS Mobile Services
Build Your Mobile App Faster with AWS Mobile Services
 
RTLS, Indoor Navigation & Proximity Marketing for Airports
RTLS, Indoor Navigation & Proximity Marketing for AirportsRTLS, Indoor Navigation & Proximity Marketing for Airports
RTLS, Indoor Navigation & Proximity Marketing for Airports
 
Mobile Analytics 101
Mobile Analytics 101Mobile Analytics 101
Mobile Analytics 101
 
Azetone: Mobile A/B Testing & Personalization
Azetone: Mobile A/B Testing & Personalization Azetone: Mobile A/B Testing & Personalization
Azetone: Mobile A/B Testing & Personalization
 
Google Mobile App Analytics
Google Mobile App AnalyticsGoogle Mobile App Analytics
Google Mobile App Analytics
 
02 cloud poweredmobileappsonaws_short
02 cloud poweredmobileappsonaws_short02 cloud poweredmobileappsonaws_short
02 cloud poweredmobileappsonaws_short
 
PhoneGap Enterprise Viewer by Anthony Rumsey
PhoneGap Enterprise Viewer by Anthony RumseyPhoneGap Enterprise Viewer by Anthony Rumsey
PhoneGap Enterprise Viewer by Anthony Rumsey
 
Has offers 'global insights performance marketing' presentation 2015 - shared
Has offers 'global insights   performance marketing' presentation 2015 - sharedHas offers 'global insights   performance marketing' presentation 2015 - shared
Has offers 'global insights performance marketing' presentation 2015 - shared
 
Azure Mobile Services
Azure Mobile ServicesAzure Mobile Services
Azure Mobile Services
 
AWS Cloud Kata 2014 | Jakarta - 2-2 Mobile
AWS Cloud Kata 2014 | Jakarta - 2-2 MobileAWS Cloud Kata 2014 | Jakarta - 2-2 Mobile
AWS Cloud Kata 2014 | Jakarta - 2-2 Mobile
 

Similar to Cross Platform Mobile Push Notifications with Azure Notifications Hub

Azure notification hubs
Azure notification hubsAzure notification hubs
Azure notification hubs
Dinusha Kumarasiri
 
Push Notification with Unity in iOS using App42 Backend
Push Notification with Unity in iOS using App42 BackendPush Notification with Unity in iOS using App42 Backend
Push Notification with Unity in iOS using App42 Backend
ShepHertz
 
Delivering Millions of Push Notifications in Minutes
Delivering Millions of Push Notifications in MinutesDelivering Millions of Push Notifications in Minutes
Delivering Millions of Push Notifications in Minutes
Sasha Goldshtein
 
Scaling push notifications to millions of devices using notification hubs
Scaling push notifications to millions of devices using notification hubsScaling push notifications to millions of devices using notification hubs
Scaling push notifications to millions of devices using notification hubscloudbeatsch
 
Net campus15 notification-hub
Net campus15 notification-hubNet campus15 notification-hub
Net campus15 notification-hubDotNetCampus
 
AZURE NOTIFICATION HUB
AZURE NOTIFICATION HUBAZURE NOTIFICATION HUB
AZURE NOTIFICATION HUB
DotNetCampus
 
Push_notifikacije_na_Azureu[1]
Push_notifikacije_na_Azureu[1]Push_notifikacije_na_Azureu[1]
Push_notifikacije_na_Azureu[1]Ivan Marković
 
Building a chat app with windows azure mobile
Building a chat app with windows azure mobileBuilding a chat app with windows azure mobile
Building a chat app with windows azure mobileFlavius-Radu Demian
 
Identifying Users Across Platforms with a Universal ID Webinar Slides
Identifying Users Across Platforms with a Universal ID Webinar SlidesIdentifying Users Across Platforms with a Universal ID Webinar Slides
Identifying Users Across Platforms with a Universal ID Webinar Slides
Looker
 
Lime - Push notifications. The big way.
Lime - Push notifications. The big way.Lime - Push notifications. The big way.
Lime - Push notifications. The big way.
Petr Dvorak
 
Engaging Your Audience with Mobile Push Notifications - GDC 2014
Engaging Your Audience with Mobile Push Notifications - GDC 2014Engaging Your Audience with Mobile Push Notifications - GDC 2014
Engaging Your Audience with Mobile Push Notifications - GDC 2014
Amazon Web Services
 
Windows 8 DevUnleashed - Session 3
Windows 8 DevUnleashed - Session 3Windows 8 DevUnleashed - Session 3
Windows 8 DevUnleashed - Session 3drudolph11
 
follow-app BOOTCAMP 2 - Windows Phone: Tiles and Notifications
follow-app BOOTCAMP 2 - Windows Phone: Tiles and Notifications follow-app BOOTCAMP 2 - Windows Phone: Tiles and Notifications
follow-app BOOTCAMP 2 - Windows Phone: Tiles and Notifications QIRIS
 
Windows Store apps development
Windows Store apps developmentWindows Store apps development
Windows Store apps development
Laurent Duveau
 
Live Tiles and Notifications in Windows Phone
Live Tiles and Notifications in Windows PhoneLive Tiles and Notifications in Windows Phone
Live Tiles and Notifications in Windows Phone
Dave Bost
 
Mini Project- USB Temperature Logging
Mini Project- USB Temperature LoggingMini Project- USB Temperature Logging
Mobile March Windows Azure Notification Hubs
Mobile March Windows Azure Notification HubsMobile March Windows Azure Notification Hubs
Mobile March Windows Azure Notification Hubs
Adam Grocholski
 
2015.04.23 Azure Mobile Services
2015.04.23 Azure Mobile Services2015.04.23 Azure Mobile Services
2015.04.23 Azure Mobile Services
Marco Parenzan
 
Introduction to Titanium and how to connect with a PHP backend
Introduction to Titanium and how to connect with a PHP backendIntroduction to Titanium and how to connect with a PHP backend
Introduction to Titanium and how to connect with a PHP backend
Joseluis Laso
 
(MBL301) Beyond the App - Extend Your User Experience with Mobile Push Notifi...
(MBL301) Beyond the App - Extend Your User Experience with Mobile Push Notifi...(MBL301) Beyond the App - Extend Your User Experience with Mobile Push Notifi...
(MBL301) Beyond the App - Extend Your User Experience with Mobile Push Notifi...
Amazon Web Services
 

Similar to Cross Platform Mobile Push Notifications with Azure Notifications Hub (20)

Azure notification hubs
Azure notification hubsAzure notification hubs
Azure notification hubs
 
Push Notification with Unity in iOS using App42 Backend
Push Notification with Unity in iOS using App42 BackendPush Notification with Unity in iOS using App42 Backend
Push Notification with Unity in iOS using App42 Backend
 
Delivering Millions of Push Notifications in Minutes
Delivering Millions of Push Notifications in MinutesDelivering Millions of Push Notifications in Minutes
Delivering Millions of Push Notifications in Minutes
 
Scaling push notifications to millions of devices using notification hubs
Scaling push notifications to millions of devices using notification hubsScaling push notifications to millions of devices using notification hubs
Scaling push notifications to millions of devices using notification hubs
 
Net campus15 notification-hub
Net campus15 notification-hubNet campus15 notification-hub
Net campus15 notification-hub
 
AZURE NOTIFICATION HUB
AZURE NOTIFICATION HUBAZURE NOTIFICATION HUB
AZURE NOTIFICATION HUB
 
Push_notifikacije_na_Azureu[1]
Push_notifikacije_na_Azureu[1]Push_notifikacije_na_Azureu[1]
Push_notifikacije_na_Azureu[1]
 
Building a chat app with windows azure mobile
Building a chat app with windows azure mobileBuilding a chat app with windows azure mobile
Building a chat app with windows azure mobile
 
Identifying Users Across Platforms with a Universal ID Webinar Slides
Identifying Users Across Platforms with a Universal ID Webinar SlidesIdentifying Users Across Platforms with a Universal ID Webinar Slides
Identifying Users Across Platforms with a Universal ID Webinar Slides
 
Lime - Push notifications. The big way.
Lime - Push notifications. The big way.Lime - Push notifications. The big way.
Lime - Push notifications. The big way.
 
Engaging Your Audience with Mobile Push Notifications - GDC 2014
Engaging Your Audience with Mobile Push Notifications - GDC 2014Engaging Your Audience with Mobile Push Notifications - GDC 2014
Engaging Your Audience with Mobile Push Notifications - GDC 2014
 
Windows 8 DevUnleashed - Session 3
Windows 8 DevUnleashed - Session 3Windows 8 DevUnleashed - Session 3
Windows 8 DevUnleashed - Session 3
 
follow-app BOOTCAMP 2 - Windows Phone: Tiles and Notifications
follow-app BOOTCAMP 2 - Windows Phone: Tiles and Notifications follow-app BOOTCAMP 2 - Windows Phone: Tiles and Notifications
follow-app BOOTCAMP 2 - Windows Phone: Tiles and Notifications
 
Windows Store apps development
Windows Store apps developmentWindows Store apps development
Windows Store apps development
 
Live Tiles and Notifications in Windows Phone
Live Tiles and Notifications in Windows PhoneLive Tiles and Notifications in Windows Phone
Live Tiles and Notifications in Windows Phone
 
Mini Project- USB Temperature Logging
Mini Project- USB Temperature LoggingMini Project- USB Temperature Logging
Mini Project- USB Temperature Logging
 
Mobile March Windows Azure Notification Hubs
Mobile March Windows Azure Notification HubsMobile March Windows Azure Notification Hubs
Mobile March Windows Azure Notification Hubs
 
2015.04.23 Azure Mobile Services
2015.04.23 Azure Mobile Services2015.04.23 Azure Mobile Services
2015.04.23 Azure Mobile Services
 
Introduction to Titanium and how to connect with a PHP backend
Introduction to Titanium and how to connect with a PHP backendIntroduction to Titanium and how to connect with a PHP backend
Introduction to Titanium and how to connect with a PHP backend
 
(MBL301) Beyond the App - Extend Your User Experience with Mobile Push Notifi...
(MBL301) Beyond the App - Extend Your User Experience with Mobile Push Notifi...(MBL301) Beyond the App - Extend Your User Experience with Mobile Push Notifi...
(MBL301) Beyond the App - Extend Your User Experience with Mobile Push Notifi...
 

Recently uploaded

Enterprise Resource Planning System in Telangana
Enterprise Resource Planning System in TelanganaEnterprise Resource Planning System in Telangana
Enterprise Resource Planning System in Telangana
NYGGS Automation Suite
 
Beyond Event Sourcing - Embracing CRUD for Wix Platform - Java.IL
Beyond Event Sourcing - Embracing CRUD for Wix Platform - Java.ILBeyond Event Sourcing - Embracing CRUD for Wix Platform - Java.IL
Beyond Event Sourcing - Embracing CRUD for Wix Platform - Java.IL
Natan Silnitsky
 
Quarkus Hidden and Forbidden Extensions
Quarkus Hidden and Forbidden ExtensionsQuarkus Hidden and Forbidden Extensions
Quarkus Hidden and Forbidden Extensions
Max Andersen
 
top nidhi software solution freedownload
top nidhi software solution freedownloadtop nidhi software solution freedownload
top nidhi software solution freedownload
vrstrong314
 
Large Language Models and the End of Programming
Large Language Models and the End of ProgrammingLarge Language Models and the End of Programming
Large Language Models and the End of Programming
Matt Welsh
 
Enhancing Project Management Efficiency_ Leveraging AI Tools like ChatGPT.pdf
Enhancing Project Management Efficiency_ Leveraging AI Tools like ChatGPT.pdfEnhancing Project Management Efficiency_ Leveraging AI Tools like ChatGPT.pdf
Enhancing Project Management Efficiency_ Leveraging AI Tools like ChatGPT.pdf
Jay Das
 
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...
Globus
 
May Marketo Masterclass, London MUG May 22 2024.pdf
May Marketo Masterclass, London MUG May 22 2024.pdfMay Marketo Masterclass, London MUG May 22 2024.pdf
May Marketo Masterclass, London MUG May 22 2024.pdf
Adele Miller
 
A Sighting of filterA in Typelevel Rite of Passage
A Sighting of filterA in Typelevel Rite of PassageA Sighting of filterA in Typelevel Rite of Passage
A Sighting of filterA in Typelevel Rite of Passage
Philip Schwarz
 
First Steps with Globus Compute Multi-User Endpoints
First Steps with Globus Compute Multi-User EndpointsFirst Steps with Globus Compute Multi-User Endpoints
First Steps with Globus Compute Multi-User Endpoints
Globus
 
Enhancing Research Orchestration Capabilities at ORNL.pdf
Enhancing Research Orchestration Capabilities at ORNL.pdfEnhancing Research Orchestration Capabilities at ORNL.pdf
Enhancing Research Orchestration Capabilities at ORNL.pdf
Globus
 
TROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERROR
TROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERRORTROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERROR
TROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERROR
Tier1 app
 
Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...
Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...
Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...
Mind IT Systems
 
Understanding Globus Data Transfers with NetSage
Understanding Globus Data Transfers with NetSageUnderstanding Globus Data Transfers with NetSage
Understanding Globus Data Transfers with NetSage
Globus
 
Prosigns: Transforming Business with Tailored Technology Solutions
Prosigns: Transforming Business with Tailored Technology SolutionsProsigns: Transforming Business with Tailored Technology Solutions
Prosigns: Transforming Business with Tailored Technology Solutions
Prosigns
 
Into the Box 2024 - Keynote Day 2 Slides.pdf
Into the Box 2024 - Keynote Day 2 Slides.pdfInto the Box 2024 - Keynote Day 2 Slides.pdf
Into the Box 2024 - Keynote Day 2 Slides.pdf
Ortus Solutions, Corp
 
Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus Compute wth IRI Workflows - GlobusWorld 2024Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus
 
Lecture 1 Introduction to games development
Lecture 1 Introduction to games developmentLecture 1 Introduction to games development
Lecture 1 Introduction to games development
abdulrafaychaudhry
 
BoxLang: Review our Visionary Licenses of 2024
BoxLang: Review our Visionary Licenses of 2024BoxLang: Review our Visionary Licenses of 2024
BoxLang: Review our Visionary Licenses of 2024
Ortus Solutions, Corp
 
Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...
Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...
Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...
informapgpstrackings
 

Recently uploaded (20)

Enterprise Resource Planning System in Telangana
Enterprise Resource Planning System in TelanganaEnterprise Resource Planning System in Telangana
Enterprise Resource Planning System in Telangana
 
Beyond Event Sourcing - Embracing CRUD for Wix Platform - Java.IL
Beyond Event Sourcing - Embracing CRUD for Wix Platform - Java.ILBeyond Event Sourcing - Embracing CRUD for Wix Platform - Java.IL
Beyond Event Sourcing - Embracing CRUD for Wix Platform - Java.IL
 
Quarkus Hidden and Forbidden Extensions
Quarkus Hidden and Forbidden ExtensionsQuarkus Hidden and Forbidden Extensions
Quarkus Hidden and Forbidden Extensions
 
top nidhi software solution freedownload
top nidhi software solution freedownloadtop nidhi software solution freedownload
top nidhi software solution freedownload
 
Large Language Models and the End of Programming
Large Language Models and the End of ProgrammingLarge Language Models and the End of Programming
Large Language Models and the End of Programming
 
Enhancing Project Management Efficiency_ Leveraging AI Tools like ChatGPT.pdf
Enhancing Project Management Efficiency_ Leveraging AI Tools like ChatGPT.pdfEnhancing Project Management Efficiency_ Leveraging AI Tools like ChatGPT.pdf
Enhancing Project Management Efficiency_ Leveraging AI Tools like ChatGPT.pdf
 
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...
 
May Marketo Masterclass, London MUG May 22 2024.pdf
May Marketo Masterclass, London MUG May 22 2024.pdfMay Marketo Masterclass, London MUG May 22 2024.pdf
May Marketo Masterclass, London MUG May 22 2024.pdf
 
A Sighting of filterA in Typelevel Rite of Passage
A Sighting of filterA in Typelevel Rite of PassageA Sighting of filterA in Typelevel Rite of Passage
A Sighting of filterA in Typelevel Rite of Passage
 
First Steps with Globus Compute Multi-User Endpoints
First Steps with Globus Compute Multi-User EndpointsFirst Steps with Globus Compute Multi-User Endpoints
First Steps with Globus Compute Multi-User Endpoints
 
Enhancing Research Orchestration Capabilities at ORNL.pdf
Enhancing Research Orchestration Capabilities at ORNL.pdfEnhancing Research Orchestration Capabilities at ORNL.pdf
Enhancing Research Orchestration Capabilities at ORNL.pdf
 
TROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERROR
TROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERRORTROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERROR
TROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERROR
 
Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...
Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...
Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...
 
Understanding Globus Data Transfers with NetSage
Understanding Globus Data Transfers with NetSageUnderstanding Globus Data Transfers with NetSage
Understanding Globus Data Transfers with NetSage
 
Prosigns: Transforming Business with Tailored Technology Solutions
Prosigns: Transforming Business with Tailored Technology SolutionsProsigns: Transforming Business with Tailored Technology Solutions
Prosigns: Transforming Business with Tailored Technology Solutions
 
Into the Box 2024 - Keynote Day 2 Slides.pdf
Into the Box 2024 - Keynote Day 2 Slides.pdfInto the Box 2024 - Keynote Day 2 Slides.pdf
Into the Box 2024 - Keynote Day 2 Slides.pdf
 
Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus Compute wth IRI Workflows - GlobusWorld 2024Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus Compute wth IRI Workflows - GlobusWorld 2024
 
Lecture 1 Introduction to games development
Lecture 1 Introduction to games developmentLecture 1 Introduction to games development
Lecture 1 Introduction to games development
 
BoxLang: Review our Visionary Licenses of 2024
BoxLang: Review our Visionary Licenses of 2024BoxLang: Review our Visionary Licenses of 2024
BoxLang: Review our Visionary Licenses of 2024
 
Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...
Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...
Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...
 

Cross Platform Mobile Push Notifications with Azure Notifications Hub

  • 1. Sending Cross Platform Notifications using Azure Notifications Hub & Xamarin Anubhav Ranjan Consultant at Xamarin, Microsoft MVP @anubhavr05 Sukriti Sharma Technical Evangelist @suksharma
  • 2. Agenda • Push Notifications • Notification Hub • Tags: Send Targeted Notifications • Templates
  • 4. Push notification lifecycle Registration at app launch 1. Client app to retrieve PNS Handle (e.g. Channel Uris, device tokens, registration IDs) 2. Updates back-end Sending Notification 1. Back-end sends notification to PNS 2. PNS pushes the notification to the app on the device Maintenance 1. Delete expired handles when PNS rejects them Platform Notification Service App back-end
  • 5. Challenges of push notifications • Different protocols to PNS’ (e.g. HTTP vs TCP, xml payload vs json payload) • Tiles vs toasts vs badges • Maintaining ChannelURI/ RegistrationID/ Token provided by PNS • Back-end complications (Storage) and Cost • Scalability
  • 6. Azure Notification Hubs (advantages) • X-plat: from any back-end to any mobile platform • No need to store device information in the app back-end (managed) • Routing and interest groups • Personalization and localization • Broadcast at scale, multicast, unicast • Telemetry
  • 7. Using Notification Hubs One-time set up 1. Create NH Register (Client) 1. Retrieve PNS Handle 2. Register with NH using PNS Handle Send Notification 1. Back-end sends message to NH 2. NH pushes it to the PNS’ *PNS – Platform Notification Service *NH – Notifications Hub APNsWNS Notification Hub App back-end iOS app Windows app MPNS GCM ADM
  • 8. •Client SDKs for • Android – GCM and ADM • iOS – APNS • Windows Phone – MPNS • Windows Store – WNS •Capable of pushing to specific platform or to all at once •Server SDKs for • REST API • .NET • Node.JS • Java Cross-Platform Push
  • 9. Some snippets Register Send await [hub registerNativeWithDeviceToken:deviceToken tags:nil completion:^(NSError* error) {…}]; hub.register(regid); var toast = @“<notification payload>"; hub.SendWindowsNativeNotificationAsync(toas t); hubService.wns.sendToastText01(null, { text1: 'Hello from Node!' }, function (error) { … } );
  • 11. Tags Tags as interest groups 1. Client app registers with tags 2. Tags are simple strings (no pre-provisioning is required) 3. Back-end can target all clients with the same tag You can use tags also for • Multiple type of interest groups, e.g. • Follow movie stars: tag “followactor:Rajnikant” • Follow users: tag “followuser:SachinTendulkar” • Tags can be user preferences or system information
  • 13. • Logic based tag pushed • Social: “All of this group but me” • Group:id && !user:id • Events: “Anyone interested in the game” • FollowTeam:RealMadrid || FollowTeam:Barcelona || EventInterest:LaLiga • Time: “@12PM in India send” • timezone:IST && follows:chinesefood Tag Expressions
  • 14. Some snippets Register await new string[] {"myTag", "myOtherTag"} [hub registerNativeWithDeviceToken:deviceToken tags:@[@"myTag", @"myOtherTag"] completion: ^(NSError* error) { … }]; hub.register(regid, "myTag“, "myOtherTag");
  • 15. Demo: Get Started - Portal Demo - Google Console - Configure your Notification Hub - Connecting your app to the Notification Hub - Send notifications from your back-end - Register with Tags
  • 17. Using templates for multi-platform push 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 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!
  • 18. Using templates for localization 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!”} 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!
  • 19. Sending geo-targeted notifications with Windows Azure Notification Hubs Some examples are: • Send coupons to all my customers in Mumbai • Send notifications of new mortgage rates/open houses in a specific locality • Notify people in a town/city about a concert they might be interested in • Notify people in a town/city of a charity/recycling event
  • 20. “How do I read tags from my hub?” • Notification Hubs is not a storage system • No cleanup needed, expires registrations automatically • 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 id • Try not to replicate device information • Register methods always overwrite tags • Each time you update the channel, overwrite all the tags
  • 21. Managing devices from your back-end When to register from your app back-end • To secure Tags • App back-end can authenticate the user before registering the device • When back-end has to modify tags • Adding a tag from the web app • Manager adding an employee to a work group • Tags are derived from analytics or other user data
  • 22. Registering from the back-end Identify your device 1. Cannot use ChannelURIs/device tokens/… 2. Keep long-living NH registration ids in device storage Register 1. First time only, a) Request registration id from hub, and b) Store it on device storage 2. CreateOrUpdate device registration (@ every app start) 3. Back-end can verify and/or add tags (e.g. performing auth) Notification Hub App back-end {id} upsert({id}, channel, tags) createId() Managing devices from your back-end
  • 23. Back-end driven tag updates Use a tag to identify user 1. Back-end usually refers to users and not devices 2. Register devices with a tag like ‘userid:{id}’ Back-end updates tags 1. Retrieve device registration(s) by userid 2. Update tags Note 1. No device information in app back-end 2. Back-end only refers to users Notification Hub App back-end getByTag(userid) update(tags) Managing devices from your back-end
  • 24. Advanced scenarios: “Push to Sync”, Retargeting
  • 25. Push to Sync Updates app state 1. Does not show a message to the user Example: music app 1. User changes playlist on desktop 2. Back-end sends a ‘push-to-sync’ notifications to user’s devices 3. Phone receives push and starts downloading new song 4. User finds the new song already on their phone! Platform-dependent Windows/Windows Phone (only lock-screen apps) iOS (only since iOS 7) Android/Kindle App back-end Notification Hub Push to sync Add new song
  • 26. Pulling it all together - Retargeting Send a targeted coupon 1. Use tags for user preferences, location, system properties, timezone, … 2. Target with tag expressions Push UX & feedback 1. Use Rich push & push to sync to provide best UX 2. Contextually report to your app back-end (who tapped, who visited the page, who received it) Retarget 1. (perform analysis on user data) 2. Update tags from your back-end with the new information 3. Send alternative offer to users that did not participate App back-end Notification Hub Loc:SF && Food Update tags Loc:SF && Food && !tapped CRM/DMP system