SlideShare a Scribd company logo
1 of 53
Thank you, sponsors!
What is Mobile Services?
Authentication out of the box
•
•

•
•

Microsoft Account
Twitter login
Google login
Facebook login
Developers.facebook.com
Setup facebook
Setup Mobile Services
Create Windows 8 project
Set table access level
Windows 8 sample application
Enable authenication
private MobileServiceUser user;
private async Task Authenticate()
{

user = await App.MobileService.LoginAsync(MobileServiceAuthenticationProvider.Facebook);
var message = string.Format("You are now logged in - {0}", user.UserId);
var dialog = new MessageDialog(message);
dialog.Commands.Add(new UICommand("OK"));
await dialog.ShowAsync();
}
protected override async void OnNavigatedTo(NavigationEventArgs e)
{

await Authenticate();
RefreshTodoItems();
}
See results on Windows 8 app
Enable authenication
private MobileServiceUser user;
private async Task Authenticate()
{

user = await App.MobileService.LoginAsync(MobileServiceAuthenticationProvider.Facebook);
var message = string.Format("You are now logged in - {0}", user.UserId);
var dialog = new MessageDialog(message);
dialog.Commands.Add(new UICommand("OK"));
await dialog.ShowAsync();
}
protected override async void OnNavigatedTo(NavigationEventArgs e)
{

await Authenticate();
RefreshTodoItems();
}
Authentication with groups on client
private FacebookSessionClient FacebookSessionClient = new FacebookSessionClient("1434104456805487");
private FacebookSession fbSession;
private MobileServiceUser user;
private async Task Authenticate()
{

fbSession = await FacebookSessionClient.LoginAsync("user_groups,user_likes,email");
var client = new FacebookClient(fbSession.AccessToken);
var token = JObject.FromObject(new { access_token = fbSession.AccessToken});
user = await App.MobileService.LoginAsync(MobileServiceAuthenticationProvider.Facebook, token);
}
protected override async void OnNavigatedTo(NavigationEventArgs e)
{
await Authenticate();
RefreshTodoItems();

}
CRUD
•

Create
• Read
• Update
• Delete
Read operation
function read(query, user, request) {
request.execute();
}
Read operation with filtering

function read(query, user, request) {
var identities = user.getIdentities();
var req = require('request');
var fbAccessToken = identities.facebook.accessToken;
var url = 'https://graph.facebook.com/me?fields=groups.fields(id)&access_token=' + fbAccessToken;
req(url, function (err, resp, body) {
var userData = JSON.parse(body);
var groups = userData.groups.data;
for(var i=0;i<groups.length;i++){
if (groups[i].id == "304013539633881")
{
request.execute();
return;
}
}
query.take(2);
request.execute();
});
}
Major features of data handling
•

Dynamic schema
• Windows Azure SQL Database
Changing table model
public class TodoItem
{
public string Id { get; set; }
[JsonProperty(PropertyName = "text")]
public string Text { get; set; }
[JsonProperty(PropertyName = "complete")]
public bool Complete { get; set; }
public string Platfrom { get; set; }
}
Changing handling logic
private async void UpdateCheckedTodoItem(TodoItem item)
{
if (item.Platfrom == null)
{
item.Platfrom = "Windows 8";
}
await todoTable.UpdateAsync(item);
items.Remove(item);
}
private void ButtonSave_Click(object sender, RoutedEventArgs e)
{
var todoItem = new TodoItem { Text = TextInput.Text, Platfrom = "Windows 8" };
InsertTodoItem(todoItem);
}
Data at portal
Data at SQL explorer
Notifications
•

Windows Phone
• Android
• iPhone
• Windows 8
Adding notifications to Windows 8
Visual Studio wizard
Reserve application name
Choose used mobile service
Notification is done!
App start and send channel to mobile service
2. Mobile service saves that into database and
sends notification
1.
Client implementation 2.0
public async static void UploadChannel(MobileServiceUser user)
{
var channel = await
PushNotificationChannelManager.CreatePushNotificationChannelForApplicationAsync();
var token = HardwareIdentification.GetPackageSpecificToken(null);
string installationId = CryptographicBuffer.EncodeToBase64String(token.Id);
var ch = new Jobject
{
{"channelUri", channel.Uri},
{"installationId", installationId},
{"userId", user.UserId.Substring(9)}
};
await App.MobileService.GetTable("channels").InsertAsync(ch);
}
private MobileServiceUser user;
protected override async void OnNavigatedTo(NavigationEventArgs e)
{
await Authenticate();
cloudbrewtapanila.cloudbrewtapanilaPush.UploadChannel(user);
RefreshTodoItems();
}
TodoItem Insert
function insert(item, user, request) {
var identities = user.getIdentities();
var fbUserId = identities.facebook.userId;
var ct = tables.getTable("channels");
ct.where({ userId: fbUserId }).read({
success: function (results) {
if (results.length > 0) {
sendNotifications(results[0].channelUri,item);
}
}
});
function sendNotifications(uri,todoItem) {
push.wns.sendToastText01(uri, { text1: "You have just inserted new todo " + todoItem.text },
{
success: function (pushResponse) {
console.log("Sent push:", pushResponse);
}
});
}
request.execute();
}
Enable from portal
Git repository
Clone your git repository
Folder structure
NPM install
Sendgrid
Sending email
var req = require('request');
var fbAccessToken = identities.facebook.accessToken;
var url = 'https://graph.facebook.com/me?fields=email&access_token=' + fbAccessToken;
req(url, function (err, resp, body) {
var userData = JSON.parse(body);
var userEmail = userData.email;
var sendgrid = require('sendgrid')("TapanilaCloudBrew", "password");
sendgrid.send({
to: userEmail,
from: 'teemu@tapanila.net',
subject: ‘New todoitem added',
text: ‘You added new todoitem ‘ + todoItem.text
});
});
Creating scheduler job
BrewCloud
function BrewCloud() {
var td = tables.getTable("TodoItem");
td.where({ complete: false }).read({
success: function (results) {
if (results.length > 0) {
var sendgrid = require('sendgrid')("TapanilaCloudBrew", "password");
sendgrid.send({
to: "teemu@tapanila.net",
from: 'teemu@tapanila.net',
subject: 'Status of brewing cloud',
text: 'There is ' + results.length + " items left“
});
}
}
});
}
Log on portal
Log on Visual Studio
What is Mobile Services?
The Cloud for
Modern Business

Grab your benefit

aka.ms/azuretry

Deploy fast in the
cloud, scale
elastically and
minimize test cost
Activate your Windows Azure MSDN
benefit at no additional charge

aka.ms/msdnsubs
cr

More Related Content

What's hot

The Ring programming language version 1.9 book - Part 82 of 210
The Ring programming language version 1.9 book - Part 82 of 210The Ring programming language version 1.9 book - Part 82 of 210
The Ring programming language version 1.9 book - Part 82 of 210Mahmoud Samir Fayed
 
Leture5 exercise onactivities
Leture5 exercise onactivitiesLeture5 exercise onactivities
Leture5 exercise onactivitiesmaamir farooq
 
XCUITest for iOS App Testing and how to test with Xcode
XCUITest for iOS App Testing and how to test with XcodeXCUITest for iOS App Testing and how to test with Xcode
XCUITest for iOS App Testing and how to test with XcodepCloudy
 
Coded ui - lesson 3 - case study - calculator
Coded ui - lesson 3 - case study - calculatorCoded ui - lesson 3 - case study - calculator
Coded ui - lesson 3 - case study - calculatorOmer Karpas
 
WAC Widget Upload Process
WAC Widget Upload ProcessWAC Widget Upload Process
WAC Widget Upload Processwacapps
 
The Ring programming language version 1.5.1 book - Part 67 of 180
The Ring programming language version 1.5.1 book - Part 67 of 180The Ring programming language version 1.5.1 book - Part 67 of 180
The Ring programming language version 1.5.1 book - Part 67 of 180Mahmoud Samir Fayed
 
Vb database connections
Vb database connectionsVb database connections
Vb database connectionsTharsikan
 
Android ui layouts ,cntls,webservices examples codes
Android ui layouts ,cntls,webservices examples codesAndroid ui layouts ,cntls,webservices examples codes
Android ui layouts ,cntls,webservices examples codesAravindharamanan S
 

What's hot (9)

The Ring programming language version 1.9 book - Part 82 of 210
The Ring programming language version 1.9 book - Part 82 of 210The Ring programming language version 1.9 book - Part 82 of 210
The Ring programming language version 1.9 book - Part 82 of 210
 
Leture5 exercise onactivities
Leture5 exercise onactivitiesLeture5 exercise onactivities
Leture5 exercise onactivities
 
XCUITest for iOS App Testing and how to test with Xcode
XCUITest for iOS App Testing and how to test with XcodeXCUITest for iOS App Testing and how to test with Xcode
XCUITest for iOS App Testing and how to test with Xcode
 
Coded ui - lesson 3 - case study - calculator
Coded ui - lesson 3 - case study - calculatorCoded ui - lesson 3 - case study - calculator
Coded ui - lesson 3 - case study - calculator
 
WAC Widget Upload Process
WAC Widget Upload ProcessWAC Widget Upload Process
WAC Widget Upload Process
 
Test script
Test scriptTest script
Test script
 
The Ring programming language version 1.5.1 book - Part 67 of 180
The Ring programming language version 1.5.1 book - Part 67 of 180The Ring programming language version 1.5.1 book - Part 67 of 180
The Ring programming language version 1.5.1 book - Part 67 of 180
 
Vb database connections
Vb database connectionsVb database connections
Vb database connections
 
Android ui layouts ,cntls,webservices examples codes
Android ui layouts ,cntls,webservices examples codesAndroid ui layouts ,cntls,webservices examples codes
Android ui layouts ,cntls,webservices examples codes
 

Viewers also liked

Tuga - SAP and Azure, Better togheter
Tuga - SAP and Azure, Better togheterTuga - SAP and Azure, Better togheter
Tuga - SAP and Azure, Better togheterGlenn Colpaert
 
SAP and Azure better together (Glenn Colpaert @TUGA IT 2016)
SAP and Azure better together (Glenn Colpaert @TUGA IT 2016)SAP and Azure better together (Glenn Colpaert @TUGA IT 2016)
SAP and Azure better together (Glenn Colpaert @TUGA IT 2016)Codit
 
Azure Resource Manager Templates
Azure Resource Manager TemplatesAzure Resource Manager Templates
Azure Resource Manager TemplatesBenjamin Hüpeden
 
SAP powered by Microsoft Azure: A match made in the cloud
SAP powered by Microsoft Azure: A match made in the cloud SAP powered by Microsoft Azure: A match made in the cloud
SAP powered by Microsoft Azure: A match made in the cloud delaware BeLux
 
SAP on Azure. Use Cases and Benefits
SAP on Azure. Use Cases and BenefitsSAP on Azure. Use Cases and Benefits
SAP on Azure. Use Cases and BenefitsmyCloudDoor
 
Leverage the Power of SAP HANA with Microsoft Azure Cloud Migration
Leverage the Power of SAP HANA with Microsoft Azure Cloud MigrationLeverage the Power of SAP HANA with Microsoft Azure Cloud Migration
Leverage the Power of SAP HANA with Microsoft Azure Cloud MigrationCapgemini
 
What is SAP| SAP Introduction | Overview of SAP
What is SAP| SAP Introduction | Overview of SAPWhat is SAP| SAP Introduction | Overview of SAP
What is SAP| SAP Introduction | Overview of SAPGlobustrainings
 
SAP INTRO
SAP INTROSAP INTRO
SAP INTRODr.Ravi
 

Viewers also liked (11)

Tuga - SAP and Azure, Better togheter
Tuga - SAP and Azure, Better togheterTuga - SAP and Azure, Better togheter
Tuga - SAP and Azure, Better togheter
 
SAP and Azure better together (Glenn Colpaert @TUGA IT 2016)
SAP and Azure better together (Glenn Colpaert @TUGA IT 2016)SAP and Azure better together (Glenn Colpaert @TUGA IT 2016)
SAP and Azure better together (Glenn Colpaert @TUGA IT 2016)
 
Azure Resource Manager Templates
Azure Resource Manager TemplatesAzure Resource Manager Templates
Azure Resource Manager Templates
 
Migrating sap wft_case_study_final (1)
Migrating sap wft_case_study_final (1)Migrating sap wft_case_study_final (1)
Migrating sap wft_case_study_final (1)
 
SAP powered by Microsoft Azure: A match made in the cloud
SAP powered by Microsoft Azure: A match made in the cloud SAP powered by Microsoft Azure: A match made in the cloud
SAP powered by Microsoft Azure: A match made in the cloud
 
SAP on Azure. Use Cases and Benefits
SAP on Azure. Use Cases and BenefitsSAP on Azure. Use Cases and Benefits
SAP on Azure. Use Cases and Benefits
 
Leverage the Power of SAP HANA with Microsoft Azure Cloud Migration
Leverage the Power of SAP HANA with Microsoft Azure Cloud MigrationLeverage the Power of SAP HANA with Microsoft Azure Cloud Migration
Leverage the Power of SAP HANA with Microsoft Azure Cloud Migration
 
SAP Basics
SAP BasicsSAP Basics
SAP Basics
 
What is SAP| SAP Introduction | Overview of SAP
What is SAP| SAP Introduction | Overview of SAPWhat is SAP| SAP Introduction | Overview of SAP
What is SAP| SAP Introduction | Overview of SAP
 
SAP INTRO
SAP INTROSAP INTRO
SAP INTRO
 
SAP for Beginners
SAP for BeginnersSAP for Beginners
SAP for Beginners
 

Similar to CloudBrew: Windows Azure Mobile Services - Next stage

GDG GeorgeTown Devfest 2014 Presentation: Android Wear: A Developer's Perspec...
GDG GeorgeTown Devfest 2014 Presentation: Android Wear: A Developer's Perspec...GDG GeorgeTown Devfest 2014 Presentation: Android Wear: A Developer's Perspec...
GDG GeorgeTown Devfest 2014 Presentation: Android Wear: A Developer's Perspec...mharkus
 
Windows Phone 7 Unleashed Session 2
Windows Phone 7 Unleashed Session 2Windows Phone 7 Unleashed Session 2
Windows Phone 7 Unleashed Session 2Wes Yanaga
 
AI: Mobile Apps That Understands Your Intention When You Typed
AI: Mobile Apps That Understands Your Intention When You TypedAI: Mobile Apps That Understands Your Intention When You Typed
AI: Mobile Apps That Understands Your Intention When You TypedMarvin Heng
 
Mobile for SharePoint with Windows Phone
Mobile for SharePoint with Windows PhoneMobile for SharePoint with Windows Phone
Mobile for SharePoint with Windows PhoneEdgewater
 
Creating an Uber Clone - Part XIII - Transcript.pdf
Creating an Uber Clone - Part XIII - Transcript.pdfCreating an Uber Clone - Part XIII - Transcript.pdf
Creating an Uber Clone - Part XIII - Transcript.pdfShaiAlmog1
 
Xamarin devdays 2017 - PT - connected apps
Xamarin devdays 2017 - PT - connected appsXamarin devdays 2017 - PT - connected apps
Xamarin devdays 2017 - PT - connected appsAlexandre Marreiros
 
Mobile 2.0 Open Ideas WorkShop: Building Social Media Enabled Apps on Android
Mobile 2.0 Open Ideas WorkShop: Building Social Media Enabled Apps on AndroidMobile 2.0 Open Ideas WorkShop: Building Social Media Enabled Apps on Android
Mobile 2.0 Open Ideas WorkShop: Building Social Media Enabled Apps on AndroidAlberto Ruibal
 
Windows Azure: Connecting the Dots for a Mobile Workforce
Windows Azure: Connecting the Dots for a Mobile WorkforceWindows Azure: Connecting the Dots for a Mobile Workforce
Windows Azure: Connecting the Dots for a Mobile WorkforceTechWell
 
Windows Azure Mobile Services
Windows Azure Mobile ServicesWindows Azure Mobile Services
Windows Azure Mobile ServicesSasha Goldshtein
 
Introduction to Firebase [Google I/O Extended Bangkok 2016]
Introduction to Firebase [Google I/O Extended Bangkok 2016]Introduction to Firebase [Google I/O Extended Bangkok 2016]
Introduction to Firebase [Google I/O Extended Bangkok 2016]Sittiphol Phanvilai
 
WinAppDriver - Windows Store Apps Test Automation
WinAppDriver - Windows Store Apps Test AutomationWinAppDriver - Windows Store Apps Test Automation
WinAppDriver - Windows Store Apps Test AutomationJeremy Kao
 
Cómo tener analíticas en tu app y no volverte loco
Cómo tener analíticas en tu app y no volverte locoCómo tener analíticas en tu app y no volverte loco
Cómo tener analíticas en tu app y no volverte locoGemma Del Olmo
 
Creating a Whatsapp Clone - Part II - Transcript.pdf
Creating a Whatsapp Clone - Part II - Transcript.pdfCreating a Whatsapp Clone - Part II - Transcript.pdf
Creating a Whatsapp Clone - Part II - Transcript.pdfShaiAlmog1
 
20150812 4시간만에 따라해보는 windows 10 앱 개발
20150812  4시간만에 따라해보는 windows 10 앱 개발20150812  4시간만에 따라해보는 windows 10 앱 개발
20150812 4시간만에 따라해보는 windows 10 앱 개발영욱 김
 
SRV421 Deep Dive with AWS Mobile Services
SRV421 Deep Dive with AWS Mobile ServicesSRV421 Deep Dive with AWS Mobile Services
SRV421 Deep Dive with AWS Mobile ServicesAmazon Web Services
 
Windows phone 7 series
Windows phone 7 seriesWindows phone 7 series
Windows phone 7 seriesopenbala
 

Similar to CloudBrew: Windows Azure Mobile Services - Next stage (20)

GDG GeorgeTown Devfest 2014 Presentation: Android Wear: A Developer's Perspec...
GDG GeorgeTown Devfest 2014 Presentation: Android Wear: A Developer's Perspec...GDG GeorgeTown Devfest 2014 Presentation: Android Wear: A Developer's Perspec...
GDG GeorgeTown Devfest 2014 Presentation: Android Wear: A Developer's Perspec...
 
Windows Phone 7 Unleashed Session 2
Windows Phone 7 Unleashed Session 2Windows Phone 7 Unleashed Session 2
Windows Phone 7 Unleashed Session 2
 
AI: Mobile Apps That Understands Your Intention When You Typed
AI: Mobile Apps That Understands Your Intention When You TypedAI: Mobile Apps That Understands Your Intention When You Typed
AI: Mobile Apps That Understands Your Intention When You Typed
 
Mobile for SharePoint with Windows Phone
Mobile for SharePoint with Windows PhoneMobile for SharePoint with Windows Phone
Mobile for SharePoint with Windows Phone
 
JavaCro'14 - Building interactive web applications with Vaadin – Peter Lehto
JavaCro'14 - Building interactive web applications with Vaadin – Peter LehtoJavaCro'14 - Building interactive web applications with Vaadin – Peter Lehto
JavaCro'14 - Building interactive web applications with Vaadin – Peter Lehto
 
Creating an Uber Clone - Part XIII - Transcript.pdf
Creating an Uber Clone - Part XIII - Transcript.pdfCreating an Uber Clone - Part XIII - Transcript.pdf
Creating an Uber Clone - Part XIII - Transcript.pdf
 
Android+ax+app+wcf
Android+ax+app+wcfAndroid+ax+app+wcf
Android+ax+app+wcf
 
Xamarin devdays 2017 - PT - connected apps
Xamarin devdays 2017 - PT - connected appsXamarin devdays 2017 - PT - connected apps
Xamarin devdays 2017 - PT - connected apps
 
Mobile 2.0 Open Ideas WorkShop: Building Social Media Enabled Apps on Android
Mobile 2.0 Open Ideas WorkShop: Building Social Media Enabled Apps on AndroidMobile 2.0 Open Ideas WorkShop: Building Social Media Enabled Apps on Android
Mobile 2.0 Open Ideas WorkShop: Building Social Media Enabled Apps on Android
 
Android ax app wcf
Android ax app wcfAndroid ax app wcf
Android ax app wcf
 
Windows Azure: Connecting the Dots for a Mobile Workforce
Windows Azure: Connecting the Dots for a Mobile WorkforceWindows Azure: Connecting the Dots for a Mobile Workforce
Windows Azure: Connecting the Dots for a Mobile Workforce
 
Windows Azure Mobile Services
Windows Azure Mobile ServicesWindows Azure Mobile Services
Windows Azure Mobile Services
 
Introduction to Firebase [Google I/O Extended Bangkok 2016]
Introduction to Firebase [Google I/O Extended Bangkok 2016]Introduction to Firebase [Google I/O Extended Bangkok 2016]
Introduction to Firebase [Google I/O Extended Bangkok 2016]
 
WinAppDriver - Windows Store Apps Test Automation
WinAppDriver - Windows Store Apps Test AutomationWinAppDriver - Windows Store Apps Test Automation
WinAppDriver - Windows Store Apps Test Automation
 
Cómo tener analíticas en tu app y no volverte loco
Cómo tener analíticas en tu app y no volverte locoCómo tener analíticas en tu app y no volverte loco
Cómo tener analíticas en tu app y no volverte loco
 
Creating a Whatsapp Clone - Part II - Transcript.pdf
Creating a Whatsapp Clone - Part II - Transcript.pdfCreating a Whatsapp Clone - Part II - Transcript.pdf
Creating a Whatsapp Clone - Part II - Transcript.pdf
 
20150812 4시간만에 따라해보는 windows 10 앱 개발
20150812  4시간만에 따라해보는 windows 10 앱 개발20150812  4시간만에 따라해보는 windows 10 앱 개발
20150812 4시간만에 따라해보는 windows 10 앱 개발
 
Bot builder v4 HOL
Bot builder v4 HOLBot builder v4 HOL
Bot builder v4 HOL
 
SRV421 Deep Dive with AWS Mobile Services
SRV421 Deep Dive with AWS Mobile ServicesSRV421 Deep Dive with AWS Mobile Services
SRV421 Deep Dive with AWS Mobile Services
 
Windows phone 7 series
Windows phone 7 seriesWindows phone 7 series
Windows phone 7 series
 

More from Teemu Tapanila

Connecting your IoT devices to azure - Techorama 2019
Connecting your IoT devices to azure - Techorama 2019Connecting your IoT devices to azure - Techorama 2019
Connecting your IoT devices to azure - Techorama 2019Teemu Tapanila
 
Deploy with confidence and speed to Microsoft azure using visual studio team ...
Deploy with confidence and speed to Microsoft azure using visual studio team ...Deploy with confidence and speed to Microsoft azure using visual studio team ...
Deploy with confidence and speed to Microsoft azure using visual studio team ...Teemu Tapanila
 
Building analytics with event grid
Building analytics with event gridBuilding analytics with event grid
Building analytics with event gridTeemu Tapanila
 
CloudBrew 2016 - Building IoT solution with Service Fabric
CloudBrew 2016 - Building IoT solution with Service FabricCloudBrew 2016 - Building IoT solution with Service Fabric
CloudBrew 2016 - Building IoT solution with Service FabricTeemu Tapanila
 
TechDays 2013: Creating backend with windows azure mobile services
TechDays 2013: Creating backend with windows azure mobile servicesTechDays 2013: Creating backend with windows azure mobile services
TechDays 2013: Creating backend with windows azure mobile servicesTeemu Tapanila
 
AppCampus Overview 19.9
AppCampus Overview 19.9AppCampus Overview 19.9
AppCampus Overview 19.9Teemu Tapanila
 

More from Teemu Tapanila (7)

Connecting your IoT devices to azure - Techorama 2019
Connecting your IoT devices to azure - Techorama 2019Connecting your IoT devices to azure - Techorama 2019
Connecting your IoT devices to azure - Techorama 2019
 
Deploy with confidence and speed to Microsoft azure using visual studio team ...
Deploy with confidence and speed to Microsoft azure using visual studio team ...Deploy with confidence and speed to Microsoft azure using visual studio team ...
Deploy with confidence and speed to Microsoft azure using visual studio team ...
 
Building analytics with event grid
Building analytics with event gridBuilding analytics with event grid
Building analytics with event grid
 
CloudBrew 2016 - Building IoT solution with Service Fabric
CloudBrew 2016 - Building IoT solution with Service FabricCloudBrew 2016 - Building IoT solution with Service Fabric
CloudBrew 2016 - Building IoT solution with Service Fabric
 
TechDays 2013: Creating backend with windows azure mobile services
TechDays 2013: Creating backend with windows azure mobile servicesTechDays 2013: Creating backend with windows azure mobile services
TechDays 2013: Creating backend with windows azure mobile services
 
AppCampus Overview 19.9
AppCampus Overview 19.9AppCampus Overview 19.9
AppCampus Overview 19.9
 
AppCampus overview
AppCampus overviewAppCampus overview
AppCampus overview
 

Recently uploaded

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
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxLoriGlavin3
 
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
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 
Sample pptx for embedding into website for demo
Sample pptx for embedding into website for demoSample pptx for embedding into website for demo
Sample pptx for embedding into website for demoHarshalMandlekar2
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxLoriGlavin3
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxLoriGlavin3
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxLoriGlavin3
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersRaghuram Pandurangan
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxLoriGlavin3
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfLoriGlavin3
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxhariprasad279825
 
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
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
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
 

Recently uploaded (20)

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
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
 
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
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 
Sample pptx for embedding into website for demo
Sample pptx for embedding into website for demoSample pptx for embedding into website for demo
Sample pptx for embedding into website for demo
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptx
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information Developers
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdf
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptx
 
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
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
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
 

CloudBrew: Windows Azure Mobile Services - Next stage

  • 1.
  • 3. What is Mobile Services?
  • 4.
  • 5. Authentication out of the box • • • • Microsoft Account Twitter login Google login Facebook login
  • 11. Windows 8 sample application
  • 12. Enable authenication private MobileServiceUser user; private async Task Authenticate() { user = await App.MobileService.LoginAsync(MobileServiceAuthenticationProvider.Facebook); var message = string.Format("You are now logged in - {0}", user.UserId); var dialog = new MessageDialog(message); dialog.Commands.Add(new UICommand("OK")); await dialog.ShowAsync(); } protected override async void OnNavigatedTo(NavigationEventArgs e) { await Authenticate(); RefreshTodoItems(); }
  • 13. See results on Windows 8 app
  • 14.
  • 15. Enable authenication private MobileServiceUser user; private async Task Authenticate() { user = await App.MobileService.LoginAsync(MobileServiceAuthenticationProvider.Facebook); var message = string.Format("You are now logged in - {0}", user.UserId); var dialog = new MessageDialog(message); dialog.Commands.Add(new UICommand("OK")); await dialog.ShowAsync(); } protected override async void OnNavigatedTo(NavigationEventArgs e) { await Authenticate(); RefreshTodoItems(); }
  • 16. Authentication with groups on client private FacebookSessionClient FacebookSessionClient = new FacebookSessionClient("1434104456805487"); private FacebookSession fbSession; private MobileServiceUser user; private async Task Authenticate() { fbSession = await FacebookSessionClient.LoginAsync("user_groups,user_likes,email"); var client = new FacebookClient(fbSession.AccessToken); var token = JObject.FromObject(new { access_token = fbSession.AccessToken}); user = await App.MobileService.LoginAsync(MobileServiceAuthenticationProvider.Facebook, token); } protected override async void OnNavigatedTo(NavigationEventArgs e) { await Authenticate(); RefreshTodoItems(); }
  • 17.
  • 19. Read operation function read(query, user, request) { request.execute(); }
  • 20. Read operation with filtering function read(query, user, request) { var identities = user.getIdentities(); var req = require('request'); var fbAccessToken = identities.facebook.accessToken; var url = 'https://graph.facebook.com/me?fields=groups.fields(id)&access_token=' + fbAccessToken; req(url, function (err, resp, body) { var userData = JSON.parse(body); var groups = userData.groups.data; for(var i=0;i<groups.length;i++){ if (groups[i].id == "304013539633881") { request.execute(); return; } } query.take(2); request.execute(); }); }
  • 21.
  • 22. Major features of data handling • Dynamic schema • Windows Azure SQL Database
  • 23. Changing table model public class TodoItem { public string Id { get; set; } [JsonProperty(PropertyName = "text")] public string Text { get; set; } [JsonProperty(PropertyName = "complete")] public bool Complete { get; set; } public string Platfrom { get; set; } }
  • 24. Changing handling logic private async void UpdateCheckedTodoItem(TodoItem item) { if (item.Platfrom == null) { item.Platfrom = "Windows 8"; } await todoTable.UpdateAsync(item); items.Remove(item); } private void ButtonSave_Click(object sender, RoutedEventArgs e) { var todoItem = new TodoItem { Text = TextInput.Text, Platfrom = "Windows 8" }; InsertTodoItem(todoItem); }
  • 26. Data at SQL explorer
  • 27.
  • 33. Notification is done! App start and send channel to mobile service 2. Mobile service saves that into database and sends notification 1.
  • 34. Client implementation 2.0 public async static void UploadChannel(MobileServiceUser user) { var channel = await PushNotificationChannelManager.CreatePushNotificationChannelForApplicationAsync(); var token = HardwareIdentification.GetPackageSpecificToken(null); string installationId = CryptographicBuffer.EncodeToBase64String(token.Id); var ch = new Jobject { {"channelUri", channel.Uri}, {"installationId", installationId}, {"userId", user.UserId.Substring(9)} }; await App.MobileService.GetTable("channels").InsertAsync(ch); } private MobileServiceUser user; protected override async void OnNavigatedTo(NavigationEventArgs e) { await Authenticate(); cloudbrewtapanila.cloudbrewtapanilaPush.UploadChannel(user); RefreshTodoItems(); }
  • 35. TodoItem Insert function insert(item, user, request) { var identities = user.getIdentities(); var fbUserId = identities.facebook.userId; var ct = tables.getTable("channels"); ct.where({ userId: fbUserId }).read({ success: function (results) { if (results.length > 0) { sendNotifications(results[0].channelUri,item); } } }); function sendNotifications(uri,todoItem) { push.wns.sendToastText01(uri, { text1: "You have just inserted new todo " + todoItem.text }, { success: function (pushResponse) { console.log("Sent push:", pushResponse); } }); } request.execute(); }
  • 36.
  • 39. Clone your git repository
  • 43. Sending email var req = require('request'); var fbAccessToken = identities.facebook.accessToken; var url = 'https://graph.facebook.com/me?fields=email&access_token=' + fbAccessToken; req(url, function (err, resp, body) { var userData = JSON.parse(body); var userEmail = userData.email; var sendgrid = require('sendgrid')("TapanilaCloudBrew", "password"); sendgrid.send({ to: userEmail, from: 'teemu@tapanila.net', subject: ‘New todoitem added', text: ‘You added new todoitem ‘ + todoItem.text }); });
  • 44.
  • 46. BrewCloud function BrewCloud() { var td = tables.getTable("TodoItem"); td.where({ complete: false }).read({ success: function (results) { if (results.length > 0) { var sendgrid = require('sendgrid')("TapanilaCloudBrew", "password"); sendgrid.send({ to: "teemu@tapanila.net", from: 'teemu@tapanila.net', subject: 'Status of brewing cloud', text: 'There is ' + results.length + " items left“ }); } } }); }
  • 47.
  • 49. Log on Visual Studio
  • 50.
  • 51. What is Mobile Services?
  • 52.
  • 53. The Cloud for Modern Business Grab your benefit aka.ms/azuretry Deploy fast in the cloud, scale elastically and minimize test cost Activate your Windows Azure MSDN benefit at no additional charge aka.ms/msdnsubs cr