Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
ASP.NET MVC4 Web APIをバックエンドにして作るストアとWindows Pho...
Search
tanaka_733
July 06, 2013
Technology
1.9k
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
ASP.NET MVC4 Web APIをバックエンドにして作るストアとWindows Phoneプッシュ通知アプリ
2013年7月6日 めとべや東京の発表資料
tanaka_733
July 06, 2013
More Decks by tanaka_733
See All by tanaka_733
SRENEXT 2020 [B5] New RelicのSREに学ぶSREのためのNew Relic活用法
tanaka733
2
11k
Calling PowerShell from CSharp
tanaka733
0
2k
Garbage Collection in .NET Framework
tanaka733
4
3k
New Features in Visual Studio 2013
tanaka733
0
1.2k
Starting Unity for Windows Store App
tanaka733
0
880
とあるインフラエンジニアのAzure活用
tanaka733
2
630
ぼくの考えた割と普通(c)なデプロイ戦略
tanaka733
1
11k
Yurufuwa_CSharp.pdf
tanaka733
0
5.1k
Windows ストアアプリで Push通知を使いこなそう
tanaka733
0
2.1k
Other Decks in Technology
See All in Technology
Getting Started with Google Antigravity
glaforge
0
320
触りたくないデータに、どう触るか AI時代のRBACアクセスガバナンス
ivry_presentationmaterials
0
280
Benchmarking Disaggregated Serving on vLLM + Dynamo with a Real Coding-Agent Workload
nttcom
1
200
Claude の新機能を、 出た日に触って社内に届けるまで
rfdnxbro
1
190
Temporal 最高!でも改めて「日付」について調べたら人類の負債すぎる件
riyaamemiya
0
180
パスキーの自動テストはどこまでいけるのか
teamlab
PRO
0
280
M5Stackで作る BLEマウス GPSログの世界
tomokusaba
PRO
0
440
アウトプット初心者、半年間のふりかえり
4o1sobblue
0
440
『SAR衛星データ解析入門』のご紹介とその応用
syuchimu
0
120
AI コーディングと人間の認知スループット / CTO Night & Day 2026 Morning Session / AI Coding and Human Cognitive Throughput
prog893
5
1.3k
AI導入は済んだ。次は統制を作り替える番だ_AI×開発組織 Summit 2026
techtekt
PRO
0
360
エンタメ企業のM&Aを支えるデータ基盤 ― 統合から店舗のリアルタイム分析まで / Data Engineering Summit 2026
genda
0
200
Featured
See All Featured
Agile Actions for Facilitating Distributed Teams - ADO2019
mkilby
0
310
The Impact of AI in SEO - AI Overviews June 2024 Edition
aleyda
6
1.2k
Making Projects Easy
brettharned
120
6.8k
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
16
2.2k
Organizational Design Perspectives: An Ontology of Organizational Design Elements
kimpetersen
PRO
1
850
Gemini Prompt Engineering: Practical Techniques for Tangible AI Outcomes
mfonobong
2
590
So, you think you're a good person
axbom
PRO
2
2.2k
A brief & incomplete history of UX Design for the World Wide Web: 1989–2019
jct
2
530
The Hidden Cost of Media on the Web [PixelPalooza 2025]
tammyeverts
2
530
Why Our Code Smells
bkeepers
PRO
340
58k
Data-driven link building: lessons from a $708K investment (BrightonSEO talk)
szymonslowik
1
1.4k
Leading Effective Engineering Teams in the AI Era
addyosmani
9
2.7k
Transcript
ASP.NET MVC 4 Web API を バックエンドにして作る ストアとWindows Phone プッシュ通知アプリ
めとべや東京 #1 2013/07/06 @tanaka_733
今日のセッションで触れるトピック 今まで何度かとりあげたプッシュ通知で 実際のアプリを作ったらどうなるか Azure Web Sites とAzure Mobile Services の違い
プッシュ通知とバックグランドタスク
自己紹介(@tanaka_733) お仕事 謎社エンジニア (インフラ) 最近は Win Server 2012 / IIS8
/ ARRv3 あたりをさわりつつ WPFとかASP.NET MVC Web API とかで管理ツールを 作ったりしてます 個人活動 めとべや東京 http://metrostyledev.net/ ブログ 銀の光と碧い空 http://techblog.hilife-jp.info/ Microsoft MVP for Visual C# 受賞しました
セッションのきっかけ 某弊社では、NewRelicというサービスを使っております .NET Framework に対応したパフォーマンス監視サービス Azureにも対応 .NET最先端技術によるハイパフォーマンスウェブアプリケーション
障害時のプッシュ通知ができます
た だ し
iPhone に限る!
Windows Phone でも 受信したい! © 2012 Microsoft Corporation. All rights
reserved.
Windows 8 でも 受信したい!!! © 2012 Microsoft Corporation. All rights
reserved.
そうだプッシュ通知を使おう
システム概要 Web Site WNS Store Client Phone Client Background Tasks
Background Tasks Web Hook Push通知 Push通知 Uri登録
ポイント サーバーサイド Azure Mobile Services を使うか、Web Sitesを使うか、 その他か Windows Store
App オフライン受信時に対応するバックグランドサービス Channel URIを更新するバックグランドサービス Windows Phone App プッシュ通知 実際に手を動かしてはまったことを中心にお話しします
あらかじめ・・・ 今回はプッシュ通知の基本的な実装の説明は省略します 以前のセッションを参考にしてください Windowsストアアプリで Push通知を使ってみよう https://speakerdeck.com/tanaka733/windowssutoaapuride- pushtong-zhi-woshi-tutemiyou Windows ストアアプリで Push通知を使いこなそう
https://speakerdeck.com/tanaka733/windows-sutoaapuride- pushtong-zhi-woshi-ikonasou
Web Sites を選んだ理由 HTTPS (SSL)で受ける必要がある(特にストアアプリ) 自前サーバーや AWS Elastic BeanStalkは SSL証明書を自前で手配する必要あり
Azure Mobile ServiceやWeb Siteは必要なし Web Hookを受ける必要あり NewRelicが障害時にWebHookに通知するため、 APIの受け口が必要 Mobile Servicesではできなかった (6月のアップデートで可能に) C# (ASP.NET MVC)でコーディングしたい 自分の好み Mobile ServicesではJavaScript (Node.js)
サーバーサイドの実装 クライアントからのChannel URIの登録を受け付けるAPI テーブルに格納する 1端末につき1つだが、 更新することがあるので、端末IDが必要 取得の仕方は各クライアントの説明で アプリとして運用を考えるなら認証を入れた方がよい WebHookのURIを受けるAPI 各サービス(今回はNewRelic)の仕様に従う
最近のトレンドはJSONでPOST 受けたあと、Channel URIの一覧を取得してWNSに配信
Azure Web Siteのデバッガビリ ティ Windows Azure SDK 2.0 で大幅強化 Visual
Studio からWeb Siteの設定が可能に ログのストリーミングが可能に 使い方 Sytem.Diagnostic.Trace を使って出力するのみ これでリモートデバッグが可能になれば無敵なのだが…
Windows Store App アプリ起動時にChannelURIの取得 前回サーバーに登録したChannel URIと比べて違えば更新 する 前回の値はSQLiteに保存 設定ファイルだと、バックグラウンドタスクとの同時編集による競合が ありうる
(頻度は少ないけど) プッシュ通知受信後の処理 外部URIをチェックしてブラウザを起動するようにする 2つのバックグランドタスクの実装 実装時に気を付けないとはまりどころ多し
バックグランドタスクの実装 バックグラウンドタスクは別プロジェクトとして実装 共通処理はクラスライブラリ化するのがおすすめ メインのプロジェクトが参照するようにする マニフェストファイルを編集して許可する アプリ実行時に登録する
ChannelURIを更新する バックグラウンドタスク ChannelURIの有効期間は1か月 1か月経つとURIは変更される可能性がある アプリの性質上1か月以上起動されない可能性がある アプリが起動されないとChannelURIの登録ができない
Windows Phone Appの実装 基本はストアアプリと同様 オフライン受信は今回対応せず プッシュ通知の配信先やフォーマットが多少異なる トースト通知として実装
まとめ C# を使って、プッシュ通知の端末側とサーバー側の両方を開 発できます Azure Web Sitesはデバッガビリティも上がって来ていて、 使いやすくなっています ストアアプリのバックグラウンドタスクを使って Channel
URIの更新を行いました 今回のアプリのソースコードはこちら(のちほど、かなり未整 理) https://github.com/tanaka-takayoshi/PushNotificationServcies