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
Notifications in iOS10
Search
Tachibana Kaoru
July 21, 2016
Technology
2k
2
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Notifications in iOS10
Tachibana Kaoru
July 21, 2016
More Decks by Tachibana Kaoru
See All by Tachibana Kaoru
GeoLocationAnchor and MKTileOverlay
toyship
0
410
Custom Group Activities
toyship
3
1.5k
Synchronized iPhones, Again!
toyship
2
1.7k
ARKit4.pdf
toyship
1
2.3k
Custom Gesture Recognizer on iOS
toyship
3
1.5k
HEVC Video with Alpha Channel
toyship
1
1.3k
RealityKit & Reality Composer
toyship
3
700
ARKit3
toyship
4
7.7k
UIViewPropertyAnimator and Easing
toyship
2
1.2k
Other Decks in Technology
See All in Technology
OpenTelemetryのメトリクスをCloudWatchに送ってPromQLで見てみた
ota1022
0
150
人間はどの意思決定を手放せるのか
kawasima
14
6.9k
Genieを崇めよ
kameitomohiro
0
130
幾何アルゴリズムで なめらかなピン操作を / iOSDC Japan 2026 / smoothpin
kazumanagano
0
350
すぐできる衛星通信対応 あとは山奥に行くだけ
tatetate55
0
130
10分で知る最近のOmarchy
komagata
0
340
Snowflakeのコスト最適化を支えるアーキテクチャ設計
ktatsuya
1
1.6k
SREは、MCPとAutopilotをこう使え!
kazumax55
2
820
OpenTelemetry eBPF Instrumentationの舞台裏 / Behind the Scenes of OpenTelemetry eBPF Instrumentation
ymotongpoo
4
1.3k
負債のメタファと2026年 / Debt Metaphor in Agentic Engineering Age 202609 Edition
twada
PRO
7
3k
安心して変更できるWebフロントエンドの作り方
pirosikick
4
2.6k
白金鉱業Meetup Vol.25 アウトカムが二値のデータに対するCausal Impact
brainpadpr
0
210
Featured
See All Featured
The Anti-SEO Checklist Checklist. Pubcon Cyber Week
ryanjones
0
240
Rebuilding a faster, lazier Slack
samanthasiow
85
9.6k
Design in an AI World
tapps
1
320
We Are The Robots
honzajavorek
0
370
Visual Storytelling: How to be a Superhuman Communicator
reverentgeek
2
660
Public Speaking Without Barfing On Your Shoes - THAT 2023
reverentgeek
1
570
The MySQL Ecosystem @ GitHub 2015
samlambert
251
13k
Un-Boring Meetings
codingconduct
0
420
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
56
3.5k
Learning to Love Humans: Emotional Interface Design
aarron
275
41k
The Language of Interfaces
destraynor
162
27k
WENDY [Excerpt]
tessaabrams
14
39k
Transcript
No#fica#ons in iOS10 2016/07/21 @TachibanaKaoru
ࣗݾհ ϑϦʔϥϯεͷiOSΤϯδχΞΛ͍ͯ͠· ͢ɻ (20168݄͔Βʂ) • Twi%er: @TachibanaKaoru • Blog :
h%p:/ /www.toyship.org/ • ϘϧμϦάϯ͖
What's new in No.fica.on of iOS • ௨ʹ"tle/sub"tle͕͚ͭΒΕΔΑ͏ʹͳͬͨ • ௨ʹΠϝʔδը૾͕͚ͭΒΕΔΑ͏ʹͳͬͨ
• ௨ʹCustom UI͕͚ͭΒΕΔΑ͏ʹͳͬͨ • Ϣʔβʔ͕௨ΛڐՄ͔ͨ͠Ͳ͏͔ͷઃఆ͕ͱΕΔΑ͏ʹͳͬ ͨ • ৴ɾະ৴ͷ௨Λ؆୯ʹϋϯυϦϯάͰ͖ΔΑ͏ʹͳͬͨ
৴ɾະ৴ͷ௨Λ؆୯ʹϋϯυ ϦϯάͰ͖ΔΑ͏ʹͳͬͨ
Local No(fica(onͱRemote No(fica(on͕౷ Ұ͞Ε·ͨ͠ɻ
Remote No(fica(on { "aps" : { "alert" : { "title"
: "Introduction to Notifications", "subtitle" : "Session 707", "body" : "Woah! These new notifications look amazing!" }, "badge" : 1 }, }
Local No(fica(on let center = UNUserNotificationCenter.current() let content = UNMutableNotificationContent()
content.title = "Hello" content.body = "This is a big news!" content.sound = UNNotificationSound.default() let trigger = UNTimeIntervalNotificationTrigger.init(timeInterval: 10, repeats: false) let request = UNNotificationRequest.init( identifier: "NewsUpdate", // ͜ͷIDΛΩʔʹͯ͠আฤूΛ͠·͢ content: content, trigger: trigger) center.add(request)
௨ͷཧ ·ͣɺ௨ͷঢ়ଶʹԼهͷ͕̏ͭ͋Γ·͢ɻ • Pending : ·ͩൃՐ͍ͯ͠ͳ͍௨ • Delivered : ൃՐ͕ͨ͠ɺϢʔβʔ͕ॲཧʢλοϓͳͲʣΛͯ͠
͍ͳ͍௨ • (Read) : Ϣʔβʔ͕ॲཧΛͨ͠௨ɹʢ͜ͷঢ়ଶͷ௨औಘͰ ͖·ͤΜɻʣ
௨ͷঢ়ଶભҠ • ొ͞Εͨ௨ɺPendingঢ়ଶͱͳΔ • τϦΨʔΠϕϯτʢ࣌ؒҐஔͳͲʣʹΑΓൃՐͯ͠Delivered ঢ়ଶͱͳΔ • Ϣʔβʔ͕ॲཧΛ͢ΔͱReadͱͳΓɺ UNUserNo2fica2onCenter͔ΒऔಘͰ͖ͳ͘ͳΔ
get pending no*fica*ons UNUserNotificationCenter.current().getPendingNotificationRequests { requests in print("== Pending Notification
: \(requests.count) == ") for request in requests { request.identifier request.content.title request.content.subtitle request.content.body request.trigger print(" -- title : \(request.content.title) body:\(request.content.body)") } }
delete pending no+fica+ons //ಛఆͷpending௨Λফ͢ UNUserNotificationCenter.current().removePendingNotificationRequests(withIdentifiers: ["NewsUpdate","NewsDelivery"]) //શ෦ͷpending௨Λফ͢ UNUserNotificationCenter.current().removeAllPendingNotificationRequests()
update pending no,fica,ons // ৽͍͠contentΛͭ͘Δ let content = UNMutableNotificationContent() content.title
= "Hello" content.body = "This is a more big news!" content.sound = UNNotificationSound.default() let trigger = UNTimeIntervalNotificationTrigger.init(timeInterval: 5, repeats: false) // ৽͍͠requestΛͭ͘Δ let newRequest = UNNotificationRequest.init(identifier: "NewsUpdate", content: content, trigger: trigger) // ৽͍͠requestΛͭ͘Δʢݹ͍ͷΛdelete͢Δඞཁͳ͍ʣ UNUserNotificationCenter.current().add(newRequest) { error in // error }
get delivered no,fica,ons UNUserNotificationCenter.current().getDeliveredNotifications { notifications in // [UNNotification]) print("==
Delivred Notification : \(notifications.count) == ") for notification in notifications { notification.date notification.request print(" -- title : \(notification.request.content.title) body:\(notification.request.content.body) date: \(notification.date)") } }
delete delivered no+fica+ons //ಛఆͷdeliver͞Εͨ௨Λফ͢ UNUserNotificationCenter.current().removeDeliveredNotifications(withIdentifiers: ["NewsUpdate","NewsDelivery"]) //શ෦ͷdeliver͞Εͨ௨Λফ͢ UNUserNotificationCenter.current().removeAllDeliveredNotifications()
No#fica#on in ac#on • ΞϓϦ͕ Foregroundʹ͋Δঢ়ଶͰ௨͕৴͞Εͨ߹ʹɺγ εςϜͷ௨ը໘ΛͩͤΔΑ͏ʹͳΓ·ͨ͠ɻ func userNotificationCenter(_ center:
UNUserNotificationCenter, willPresent notification: UNNotification, withCompletionHandler completionHandler: (UNNotificationPresentationOptions) -> Void) { print("! Notification came!\(notification.request.content.title)") completionHandler([.alert, .sound])// ͜ΕΛ͍Ε͓ͯ͘ͱɺγεςϜͷ௨ը໘Λͩͯ͘͠ΕΔ }
iOS9ͱiOS10ͷ௨ϋϯυϦϯάͷҧ͍ • Fav௨ • iOS9·ͰɺFav͞ΕΔͨͼʹ௨͕͘ΔͷͰɺ௨ཝ͕ಛ ఆͷtweetͷFav௨Ͱ͏·ͬͯ͠·ͬͨ • iOS10ͰɺFav͞ΕΔͨͼʹ௨Λߋ৽͢ΔͨΊɺಛఆͷ tweetͷFav௨ৗʹҰͭ
iOS9ͱiOS10ͷ௨ϋϯυϦϯάͷҧ͍ • ίϝϯτ௨ • iOS9·Ͱɺίϝϯτ͕ͭͨ͘ͼʹ௨Λૹ͍ͬͯͨͨΊɺ Γ͕͍͋ͬͯΔεϨουͷίϝϯτ௨Ͱ͏·ͬͯ͠·ͬ ͨ • iOS10Ͱɺίϝϯτ͕ͭͨ͘ͼʹ௨Λߋ৽͢ΔͨΊɺಛ ఆͷεϨουͷ௨ৗʹҰͭ
·ͱΊ • iOS10Ͱ௨ͷ༰Λมߋ͢Δ͜ͱ͕Ͱ͖ΔΑ͏ʹͳͬͨͨ Ίɺॊೈͳ௨ઃܭ͕Ͱ͖ΔΑ͏ʹͳΓ·ͨ͠ • ແବͳ௨Λ;ͣ͞ɺ͢Ͱʹ͋Δ௨Λߋ৽͠Α͏ • ΞϓϦ௨ͰɺγεςϜ௨ը໘Λදࣔ͠Α͏