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
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
Shinichi Goto
April 20, 2016
Programming
11k
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
debug-remote-local-notification-on-watchos
potatotips #28
Shinichi Goto
April 20, 2016
More Decks by Shinichi Goto
See All by Shinichi Goto
WWDC18 ML Overview
_shingt
1
1.5k
Core ML 🏃 iOS Engineer
_shingt
1
680
Core ML / Vision Frameworkを使ってできること / What can we achieve using Core ML and Vision framework
_shingt
3
4.6k
Wantedly Peopleのスキャン画面の裏側 / Wantedly People Scanning Screen
_shingt
6
6.6k
Providing Better Feedback in Real-time Object Detection Apps
_shingt
2
1.7k
Value Types in WWDC16
_shingt
3
2.6k
Server Side Swift question
_shingt
3
1.2k
Other Decks in Programming
See All in Programming
AI 輔助遺留系統現代化的經驗分享
jame2408
1
1.2k
Apache Hive: そしてCloud Native Lakehouseへ
okumin
1
130
【やさしく解説 設計編 #1】「ドメイン駆動」と「実装駆動」ってなに? 〜設計の考え方を、たとえ話で学ぼう〜
panda728
PRO
1
120
PHP Application における Kubernetes 内 gRPC 通信
ganchiku
0
450
yield再入門 #phpcon
o0h
PRO
0
440
【やさしく解説 設計編・中級 #4】ルールの寿命と、システムの年輪
panda728
PRO
2
140
エンジニア向け会社紹介/Findy Company Profile
findyinc
6
360k
AIを活用したE2Eテスト実装効率化のあゆみ / ebisu-mobile-14-kotetu
kotetuco
0
170
鹿野さんに聞く!『TypeScriptコードレシピ集』で磨く実践力
tonkotsuboy_com
4
1.1k
「正の参照」と 「負の導出」で組む ハーネスエンジニアリング
cottpan
1
140
PHP に部分適用が来るぞ!……ところで何それ?おいしいの? #phpcon / phpcon-2026
shogogg
0
220
LLMによるContent Moderationの本番運用の裏側と品質担保への挑戦
suikabar
3
850
Featured
See All Featured
The Director’s Chair: Orchestrating AI for Truly Effective Learning
tmiket
1
220
What the history of the web can teach us about the future of AI
inesmontani
PRO
1
630
Future Trends and Review - Lecture 12 - Web Technologies (1019888BNR)
signer
PRO
0
3.6k
Stop Working from a Prison Cell
hatefulcrawdad
274
21k
Introduction to Domain-Driven Design and Collaborative software design
baasie
1
900
No one is an island. Learnings from fostering a developers community.
thoeni
21
3.8k
Building AI with AI
inesmontani
PRO
1
1.1k
Tell your own story through comics
letsgokoyo
1
990
Collaborative Software Design: How to facilitate domain modelling decisions
baasie
1
260
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
234
17k
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
52
6k
How to Align SEO within the Product Triangle To Get Buy-In & Support - #RIMC
aleyda
2
1.7k
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...γϛϡϨʔλͷ߹ͪΐͬͱ͢Δ ͱྑͦ͞͏
ऴΘΓ !