Upload
shotaro-suzuki
View
627
Download
2
Embed Size (px)
DESCRIPTION
7/6 業開発中心会議でのセッションスライドです。
Citation preview
z
アクセス制御(ACS & AD)
モバイル(Mobile)
iOS/Android
Win8/WP8
SQL データベース(SQL Database)
ストレージ(Storage)
トラフィック管理(Traffic Manager)
仮想ネットワーク(Virtual Network)
メディア配信(Media)
コンテンツ配信(CDN)
サービスバス(Service Bus)
キャッシュ(Caching)
仮想マシン(Virtual Machines、Linuxも含む)
クラウドサービス(Cloud Services)
Web サイト(Web Sites)
3
Android、iOS、Windows 8 (JavaScript、C#)、Windows Phone、HTML5
向けのSDK
データ
電子メール、SMS、Windows Azureサービスバスなど、Windows Azureやパートナーのサービスを利用可能
Mobile Services の内実
・データアクセス、プッシュ通知、認証サポートWindows 8、Windows Phone 8 SDK、iOS SDK SDK、AndroidSDK、HTML5/JavaScript SDK
・強力なサーバーサイドスクリプトのサポートプッシュ通知、バリデーション、プリプロセッシング、ポストプロセッシング、他の Web サービスとの連携
http://msdn.microsoft.com/en-us/library/windowsazure/jj554226.aspx
Supported Modules + Globals
mssql
request
console
push
tables
statusCodes
複雑なフィルタリングの例
function read(query, user, request) {query.where(function (userId) {
return this.UserId == userId;}, user.userId);request.execute();
}
function read(query, user, request) {query.where(function (userId) {
return this.UserId == userId &&(this.Category == "Fiction" || this.Category == "Action") &&this.Rating > 2;
}, user.userId);request.execute();
}…
アプリケーションキーを持つ
ユーザー(デフォルト値)
https://manage.dev.live.com/Applications/Index
Live Connect ポータル
https://appdev.microsoft.com/StorePortals/ja-jp/Home/Index?wa=wsignin1.0
Windows Store 開発ポータル
アプリ起動時に登録① アプリは PNS (Platform Notification Service)にア
クセスして Handle を取得 (e.g. ChannelURI, Device Token)
② アプリはバックエンドのハンドル情報を更新
通知を送信③ バックエンドはPNSへ通知を送信
④ PNSがデバイスのアプリへ通知をプッシュ
メンテナンスPNS がリジェクトしたタイミングで、バックエンドは有効期限切れのハンドルを削除
PNS(APNS/WNS
/GCM)
アプリのバックエンド
アプリ①
②
③
④
Handle 、ユーザー属性を保持
バックグラウンド処理を行うジョブを作成設定された時刻に定期的な処理を自動実行させることが容易
定期的なプッシュ通知
Webサイトを定期的に監視
定期的なデータ整理・取得(古い情報や重複の削除、TweetやRSS収集など)
http://www.windowsazure.com/ja-jp/pricing/details/mobile-services/
MBaaS として基本機能が充実
スケーラブルなプッシュ通知
Visual Studio 2013 との連携
リソースは Appendix および講演者ブログで http://blogs.msdn.com/b/shosuz/
Appendix
Windows ストアアプリのサンプルオンライン楽器ストアアプリ
各商品を表示 タイトルを編集 詳細情報編集、削除可能
スタートスクリーン
全商品表示(Hub) 一覧・登録(Sections)
個別商品表示・編集(Details)
アーキテクチャー概要
Windows ストアアプリ・店舗管理者用 - 編集・登録・一般ユーザー用 - 閲覧・購入・
プッシュ通知(Mobile Services)・メール(SendGrid)
20
En
tity
Fra
mew
ork
SQL Database
Windows Azure Web サイト
Windows Azure
Windows AzureWebsites
Windows Azure SQL Database
Windows Azure Storage (BLOB)
画像文字数値
ASP.NET Web API
Entity
Framew
orkドメイン
モデル
店舗管理者
一般ユーザー
Gridテンプレート
Get/Post/
Put/Delete
JSONREST
Code F
irst
サイドローディング
Windowsストア
文字・写真を投稿するMini Blog iOS アプリ
テーブルのリレーション
tags タグテーブル
id ID
name タグ名
userId ユーザーID
posttags 投稿・タグ関連テーブル
id ID
postId 投稿ID
tagId タグID
devices デバイステーブル
id ID
token トークン
userId ユーザーID userIdは認証時にモバイルサービスが発行tokenはプッシュ通知利用時にiOSが発行
posts 投稿テーブル
id ID
text テキスト
userId ユーザーID
image 画像
shared 共有フラグ
Register your apps for Twitter login with Mobile Servicesチュートリアルhttp://www.windowsazure.com/en-us/develop/mobile/how-to-guides/register-for-twitter-authentication/
https://dev.twitter.com/
https://dev.twitter.com/apps/new
Visual Studio では Intellisense で Identity Provider を選択可能
Windows 8 / Windows Phone 8
iOS
If (MobileService.CurrentUser == null) {
var user = await MobileSevice.LoginAsync (
MobileServiceAuthenticationProvider.Twitter);
If (client.currentUser == nil) {
[client loginViewControllerWithProvider : @”twitter”
completion : ^(MSUser* user, NSError* err) {
//…
}];
}
Platform
Notification
Service
(APNS/WNS/
GCM)
App back-end
push.wns
push.mpns
http://msdn.microsoft.com/ja-JP/windows/apps
https://manage.dev.live.com/Applications/Index
Live Connect ポータル
Windows ストアアプリポータル
APNSと連携したプッシュ通知
iOS
通知 通知依頼
フィードバック
トークン登録
登録・トークン取得
Google Cloud Messaging と連携したプッシュ通知
Android
通知 通知依頼
フィードバック
トークン登録
登録・トークン取得
http://blogs.msdn.com/b/shosuz/archive/2013/01/03/sendgrid-windows-azure-mobile-services.aspx
Windows 8
Windows Phone 8
Server Side Script
CurrentChannel = await PushNotificationChannelManager.CreatePushNotificationChannelForApplicaionAsync();
CurrentChannel = new HttpNotificationCannel(“ApartmentPushChannel”);CurrentChannel.Open();
CurrentChannel.BindToShellToast();
mpns.sendToast(channel.uri, “New Apartment Added”, apartment.address);
wns.sendToat02(channel.uri,
{text01 : “New Apartment Added”, text02 : apartment.address, });
35http://www.windowsazure.com/mobile
Mobile Services Developer Portal
http://blogs.msdn.com/b/shosuz/archive/2013/01/11/windows-azure-new-code-samples-and-tutorials.aspx
Github
https://github.com/WindowsAzure/azure-mobile-services
Get started with Mobile Services for iOS
http://www.windowsazure.com/en-us/develop/mobile/tutorials/get-started-ios/
Github
https://github.com/WindowsAzure/azure-mobile-services
Get started with Mobile Services for Android
http://www.windowsazure.com/en-us/develop/mobile/tutorials/get-started-android/
MiniBlogソースコードhttp://msdn.microsoft.com/ja-jp/windowsazure/hh697503
・SQL Database へのCRUD
・複数テーブルのリレーション
・豊富なサーバー側JavaScript サンプル
・Client 側は iOS 6.0以降に対応
・Storyboard、ARC 等対応
Event Buddy(iOS)イベント・セッション情報の閲覧、新しい イベント・セッション情報の入力が可能。セッションは詳細情報と評価も可能。
Tic Tac Toe Leaderboard(iOS/Android)Mobile Services 上の単純な Leaderboard。
Tic Tac Toe ゲームの勝敗の記録が可能
Feedback (iOS/Android)iOS /Android からフィードバックを行えるアプリ。評価送信前に、コメント、e-mail アドレス、五段階評価を付与可能。