More Related Content Similar to Windows azure multi_device_mobileservices (20) More from Shotaro Suzuki (20) Windows azure multi_device_mobileservices3. 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
7. 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();
}
…
10. アプリ起動時に登録
① アプリは PNS (Platform Notification Service)にア
クセスして Handle を取得 (e.g. ChannelURI, Device
Token)
② アプリはバックエンドのハンドル情報を更新
通知を送信
③ バックエンドはPNSへ通知を送信
④ PNSがデバイスのアプリへ通知をプッシュ
メンテナンス
PNS がリジェクトしたタイミングで、バックエンドは有効
期限切れのハンドルを削除
PNS
(APNS/WNS
/GCM)
アプリの
バックエンド
アプリ
①
②
③
④
Handle 、ユー
ザー属性を保持
16. MBaaS として基本機能が充実
スケーラブルなプッシュ通知
Visual Studio 2013 との連携
リソースは Appendix および講演者ブログで
http://blogs.msdn.com/b/shosuz/
20. アーキテクチャー概要
Windows ストアアプリ
・店舗管理者用 - 編集・登録
・一般ユーザー用 - 閲覧・購入・
プッシュ通知(Mobile Services)・
メール(SendGrid)
20
Entity
Framework
SQL Database
Windows Azure
Web サイト
Windows Azure
Windows Azure
Websites
Windows Azure
SQL Database
Windows Azure
Storage (BLOB)
画像
文字
数値
ASP.NET Web API
Entity
Framework
ドメイン
モデル
店舗
管理者
一般
ユーザー
Grid
テンプレート
Get/Post/
Put/Delete
JSON
REST
CodeFirst
サイド
ローディング
Windows
ストア
22. テーブルのリレーション
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 共有フラグ
23. 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
25. 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) {
//…
}];
}
34. 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, });