Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
debug-remote-local-notification-on-watchos
Search
Shinichi Goto
April 20, 2016
Programming
0
11k
debug-remote-local-notification-on-watchos
potatotips #28
Shinichi Goto
April 20, 2016
Tweet
Share
More Decks by Shinichi Goto
See All by Shinichi Goto
WWDC18 ML Overview
_shingt
1
1.4k
Core ML 🏃 iOS Engineer
_shingt
1
600
Core ML / Vision Frameworkを使ってできること / What can we achieve using Core ML and Vision framework
_shingt
3
4.4k
Wantedly Peopleのスキャン画面の裏側 / Wantedly People Scanning Screen
_shingt
6
6.5k
Providing Better Feedback in Real-time Object Detection Apps
_shingt
2
1.5k
Value Types in WWDC16
_shingt
3
2.6k
Server Side Swift question
_shingt
3
1.1k
Other Decks in Programming
See All in Programming
モビリティSaaSにおけるデータ利活用の発展
nealle
0
340
Agentに至る道 〜なぜLLMは自動でコードを書けるようになったのか〜
mackee
5
1.5k
アーキテクチャと考える迷子にならない開発者テスト
irof
8
3k
高単価案件で働くための心構え
nullnull
0
140
仕様がそのままテストになる!Javaで始める振る舞い駆動開発
ohmori_yusuke
8
4.3k
AI駆動開発ライフサイクル(AI-DLC)のホワイトペーパーを解説
swxhariu5
0
990
自動テストのアーキテクチャとその理由ー大規模ゲーム開発の場合ー
segadevtech
2
1k
乱雑なコードの整理から学ぶ設計の初歩
masuda220
PRO
31
13k
オフライン対応!Flutterアプリに全文検索エンジンを実装する @FlutterKaigi2025
itsmedreamwalker
2
210
自動テストを活かすためのテスト分析・テスト設計の進め方/JaSST25 Shikoku
goyoki
3
680
「10分以内に機能を消せる状態」 の実現のためにやっていること
togishima
1
440
Verilator + Rust + gRPC と Efinix の RISC-V でAIアクセラレータをAIで作ってる話 RTLを語る会(18) 2025/11/08
ryuz88
0
360
Featured
See All Featured
Designing Dashboards & Data Visualisations in Web Apps
destraynor
231
54k
Documentation Writing (for coders)
carmenintech
76
5.1k
Navigating Team Friction
lara
190
15k
Why Our Code Smells
bkeepers
PRO
340
57k
[RailsConf 2023] Rails as a piece of cake
palkan
57
6.1k
Evolution of real-time – Irina Nazarova, EuRuKo, 2024
irinanazarova
9
1k
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
132
19k
How Fast Is Fast Enough? [PerfNow 2025]
tammyeverts
3
320
The World Runs on Bad Software
bkeepers
PRO
72
12k
How to Think Like a Performance Engineer
csswizardry
28
2.3k
Reflections from 52 weeks, 52 projects
jeffersonlam
355
21k
Done Done
chrislema
186
16k
Transcript
Debug Remote / Local No1fica1on on watchOS ɹ potato%ps-28 2016/4/20
@shingt
Wantedly
No#fica#ons
None
watchOS No+fica+on Components • Short-look • Long-look • Sta.c •
Dynamic • Remote or Local • Ac.onable items • First view (kinds different from iOS)
watchOS No+fica+on Components • Short-look • Long-look • Sta.c •
Dynamic • Remote or Local • Ac.onable items • First view (kinds different from iOS)
Complicated (Compared to iOS)
Debugging
Debug No)fica)on • Remote no)fica)on • On simulator • On
device • Local no)fica)on • On simulator • On device
Remote No(fica(on • On simulator • Provided on Xcode !
• Custom Build Scheme with No8fica8on Interface • Describe no8fica8on payload in json • breakpoint "
MessagePayload.apns { "aps": { "alert": { "body": "Wantedly, Inc.͔Βϝοηʔδ͕ಧ͖·ͨ͠", "title":
"৽ணϝοηʔδ" }, "category": "MESSAGE_CATEGORY", }, "message": { "id": 1, "body": "͜ΜʹͪʂాதͰ͢ɻ\n͜ͷWantedlyʹڵຯΛ͍࣋ͬͯͯ͋Γ͕ͱ͏͍͟͝·͢ɻ", "company_name": "Wantedly, Inc.", ... }, "WatchKit Simulator Actions": [ ... ] }
Remote No(fica(on • On simulator • Provided on Xcode !
• Custom Build Scheme with No:fica:on Interface • Describe no:fica:on payload in json • breakpoint " • On device • Just send it :)
Local No(fica(on on Simulator • Want • Easily debug •
Problem • Not provided on Xcode • Different from remote no=fica=on on simulator • Solu=on? • Use remote no=fica=on debugging instead?
Solu%on? ## Debug override func didReceiveRemoteNotification( remoteNotification: [NSObject : AnyObject],
withCompletion completionHandler: (WKUserNotificationInterfaceType) -> Void) {...} ## Production override func didReceiveLocalNotification( localNotification: UILocalNotification, withCompletion completionHandler: (WKUserNotificationInterfaceType) -> Void) {...}
Problem ## Debug override func didReceiveRemoteNotification( remoteNotification: [NSObject : AnyObject],
withCompletion completionHandler: (WKUserNotificationInterfaceType) -> Void) {...} ## Production override func didReceiveLocalNotification( localNotification: UILocalNotification, withCompletion completionHandler: (WKUserNotificationInterfaceType) -> Void) {...} ɹ remoteNotification != localNotification
Sender UILocalNotification *notification = [UILocalNotification new]; notification.alertBody = [company.name stringByAppendingString:@"͕ۙ͘ʹ͋Γ·͢"];
notification.alertTitle = @"ۙ͘ͷձࣾ"; notification.category = @"COMPANY_LOCATION"; notification.userInfo = [company toJSON];
Prepare wrapper object
None
None
• Easy to debug • Assump1on: NotificationPayload works appropriately •
Cannot test sender
Local No(fica(on on Device • Problem • Hard to send
(depending on applica5on) • Needs to send no5fica5on while iOS device is asleep • Solu5on • Basically same as debugging iOS local no5fica5on
- (void)application:(UIApplication *)application performFetchWithCompletionHandler:... { ... [self methodForLocalNotification]; // For
debug ... }
Run iOS app => Sleep => "Simulate Background Fetch"
Summary • Debugging No,fica,on • Remote...؆୯ • Local...γϛϡϨʔλͷ߹ͪΐͬͱ͢Δ ͱྑͦ͞͏
ऴΘΓ !