global azure bootcamp 2015 taichung : mobile service

42
Azure Mobile Service Ian Chen 2015.4.25

Upload: ian-chen

Post on 15-Jul-2015

55 views

Category:

Technology


1 download

TRANSCRIPT

Azure Mobile Service

Ian Chen 2015.4.25

About Me•Microsoft MVP (ASP.NET)•TechDays 2014 講師

•MVP 2015 微軟實戰課程日 講師

• html5 & javascript程式開發實戰書籍共同作者

•Study4.TW 社群成員 www.facebook.com/Study4.tw• K.NET 社群成員 www.facebook.com/knet.io•www.dotblogs.com.tw/ian• [email protected]

2

Agenda

3

• Introduction Mobile Service• Data Access• Authentication• Push Notification

Agenda

4

• 範例會以Windows Phone為例• iOS / Android 可參考Azure 線上文件庫,自行改用相關SDK• http://azure.microsoft.com/zh-

tw/develop/mobile/ios/• http://azure.microsoft.com/zh-

tw/develop/mobile/android/• http://azure.microsoft.com/zh-

tw/develop/mobile/xamarin/

Introduction Mobile Service

想一下!!你想要做個優惠資訊的MVP APP

MVP = Minimum Viable Product 最低可行性的產品

•優惠資料顯示

•整合社群驗證,會員可享有VIP優惠

•新優惠資料主動推播

7Microsoft Azure

APP功能

所以你需要………

•硬體• 需要一個Data Base Server – 儲存優惠資料

• 需要一台Web Service Server – 對外提供資料取得的服務

•應用程式• Web Service or RESTful Service• 授權驗證(facebook、google、Microsoft account、 Twitter …)• 推播(iOS、android、windows)

9Microsoft Azure

就這樣……….一個月過去了,只是在搞提供APP所需要的Back end服務及環境,但真正要做的APP進度………………0%

Azure Mobile Service

•基於Cloud,專門為行動平台 APP開發而提供的整合式服務• SQL Database Service• RESTful Service• 整合社群驗證 (Facebook、Google、 Twitter 、 Microsoft

Account)• 推播

•架構於現有的PaaS•可依使用情況進行延展,具有高延展性

11Microsoft Azure

Azure Mobile Service

• .Net Backend - WebAPI + Entity Framework•JavaScript Backend – Node.js

12Microsoft Azure

於是……….有了WAMS,80%的時間可以專注於APP本體的開發

DemoCreate Mobile Service

• http://goo.gl/wHmfQR

• http://goo.gl/L04OPi

15Microsoft Azure

Reference

•Azure SQL Service

• Free 20 MB (All Mobile Service Share)

• Customize RESTful Service (Cross-Platform)

16Microsoft Azure

資料存取

資料存取

•同步離線資料與行動服務•離線 - 暫存設備本機SQLite•重新連線 - 進行Sync動作

17

DemoData Access

• http://goo.gl/8GZGS7

• http://goo.gl/4VwGWw

• http://goo.gl/TLK84Y

19Microsoft Azure

Reference

Authentication

•自製會員管理機制麻煩(帳號管理、個資管理、安全性)

•社群帳號普及(Facebook、Google、 Twitter 、 Microsoft Account)

21Microsoft Azure

Authentication

•Uses oAuth

•Mobile Service is registered with provider to allow auth

• Client calls auth method and passes in provider name

•User ID and token (for Mobile Service) returned to client

22Microsoft Azure

Authentication

• Register facebook dev (developers.facebook.com)

23Microsoft Azure

Facebook

•Add New APP – Choose Website

24Microsoft Azure

Facebook

•App Domains – your WAMS Domain

25Microsoft Azure

Facebook

•Add Platform

26Microsoft Azure

Facebook

• Site URL – your WAMS url

•Mobile Site URL - your WAMS url

27Microsoft Azure

Facebook

•OAuth Settings – your WAMS url + /login/facebook

28Microsoft Azure

Facebook

• Enable Auth Service

29Microsoft Azure

Facebook

•Mobile Service Portal – 識別

•應用程式識別碼/API 金鑰 – Facebook應用程式 ID

•應用程式機密 – Facebook 應用程式密鑰

30Microsoft Azure

Facebook

DemoFacebook Auth

• http://goo.gl/y3xP90

• http://goo.gl/56bl6E

32Microsoft Azure

Reference

Push Notifications

Push Notification

Push Notification

Mobile Service Handling

•支援主要的行動平台 (Windows Store / Windows Phone、iOS、Android)。

•通知中心提供一貫且統一基礎結構來建立和管理裝置註冊

•高擴充性(millions of pushes in minutes)

36Microsoft Azure

Push Notification

• Get PushChannel

• Register PushChannel

•APP Enable Notification

37Microsoft Azure

Push Notification

DemoPush Notifications

• http://goo.gl/9pmxe1

• http://goo.gl/DfYGS2

• http://goo.gl/FfzFJZ

• http://goo.gl/ZvyvaK

39Microsoft Azure

Reference

Azure Mobile Service

40Microsoft Azure

Q & A

• http://goo.gl/RpWMwu

• http://goo.gl/HeIcdh

• http://goo.gl/a0HkYN

• http://goo.gl/YtXcei

42Microsoft Azure

Reference