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
Custom Group Activities
Search
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
Tachibana Kaoru
June 23, 2021
Technology
1.5k
3
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Custom Group Activities
Tachibana Kaoru
June 23, 2021
Transcript
30 slides
Custom Group Activities @TachibanaKaoru 2021/06/23 #potatotips #74
ࣗݾհ @TachibanaKaoru Freelance iOS Engineer ࠓͷWWDCΧφμͰݟ͍ͯ·ͨ͠ɻ ࠓ·ͩؼࠃޙͷೋिִؒظؒதɻ
Custom Group Activitiesͱ FaceTimeͷηογϣϯΛͬͯΞϓϦಠࣗͷใΛΓͱΓ͢Δ͜ͱ͕ Ͱ͖ΔΈɻ αʔόʔΛ༻ҙͤͣʹήʔϜͷάϧʔϓରઓάϧʔϓ࡞ۀͳͲΛ࣮ ͢Δ͜ͱ͕Ͱ͖Δɻ iOS15͔Βαϙʔτ
None
None
None
None
How to implement Group Activities add entitlement (com.apple.developer.group-session) de fi
ne activity model prepareForActivation activate join
de fi ne activity model struct TextTogetherActivity: GroupActivity{ static let
activityIdentifier = "org.toyship.characters.text" } extension TextTogetherActivity{ var metadata: GroupActivityMetadata{ var data = GroupActivityMetadata() data.type = .generic data.title = "character" data.fallbackURL = URL(string: "") return data } }
prepareForActivation let myActivity = TextTogetherActivity() async { switch await myActivity.prepareForActivation()
{ case .activationDisabled: prepareStateLabel.text = "(disable)" case .activationPreferred: prepareStateLabel.text = "prepare OK" case .cancelled: prepareStateLabel.text = "cancelled" default: prepareStateLabel.text = "(unknown status)" } }
activate let myActivity = TextTogetherActivity() myActivity.activate()
join async{ for await session in TextTogetherActivity.sessions(){ switch session.state{ case
GroupSession<TextTogetherActivity>.State.joined: break case GroupSession<TextTogetherActivity>.State.waiting: session.join() default: break } } }
Group Activities Session FaceTime session Group Activities session
Group Activities Session FaceTime session ActivityΛ ࡞ͬͯ activate ͢Δ Group
Activities session FactTimeͷsession͕͋Δঢ়ଶͰactivateΛ͢ΔͱɺଞͷࢀՃ ऀʹԻͰ௨͞Ε·͢ɻ
Group Activities Session FaceTime session Group Activities session join APIͰjoinΛݺͿલʹɺsystem
UIͰɺ ʮΞϓϦ໊ʯʹࢀՃ͠·͔͢ʁͱ͍ ͏μΠΞϩάʹOK͢Δඞཁ͋Γɻ
System UI Dialog Here!
Group Activities Session FaceTime session Group Activities session join
Group Activities Session FaceTime session Group Activities session
Session timeline prepareForActivation prepareForActivation activate join session owner (system UI
Ͱ OK)
How to send and receive messages de fi ne message
model send message receive message
de fi ne message model struct ShareText: Codable{ let id:
UUID var name: String var position: CGPoint = CGPoint(x: 0, y: 0) var red: CGFloat = 1.0 var green: CGFloat = 1.0 var blue: CGFloat = 1.0 var alpha: CGFloat = 1.0 }
send message let messenger = GroupSessionMessenger(session: session) let newData =
ShareText(id: UUID(), name: "Hello") messenger.send(newData, completion: {error in // check error })
receive message async{ for await session in TextTogetherActivity.sessions(){ let messenger
= GroupSessionMessenger(session: session) let task: Task.Handle = detach { [weak self] in for await (message, _ ) in messenger.messages(of: ShareText.self){ await self?.checkReceivedText(message) } } tasks.insert(task) } }
Session information ηογϣϯʹࢀՃ͍ͯ͠Δਓ֬ೝՄೳ ͨͩ͠ɺਓ૿ݮͷ௨ͳͲൃੜ͠ͳ͍ ηογϣϯʹࢀՃ͍ͯ͠ΔਓͷใʢFaceTimeΞΧϯτ໊ͳͲʣऔಘͰ ͖ͳ͍ɻ ૹड৴ϝοηʔδʹɺࢀՃऀͷIDʢಗ໊IDʣՃ͞Ε͍ͯΔ͕ɺͦΕҎ্ ͷใͳ͍ͨΊɺඞཁͳ߹ʹɺૹड৴ϝοηʔδʹؚΊͨ΄͏͕Α͍ɻ
Pros and Cons ηογϣϯΛཧ͢Δඞཁ͕ʢ͋·Γʣͳ͍ αʔόʔߏஙͷඞཁ͕ͳ͍
Pros and Cons FaceTimeͷΞΧϯτ͕ඞཁ iOS15͕ඞཁ ࢀՃऀͷใ͕खʹೖΒͳ͍
delay on Group Activities ݱ࣌ͰɺηογϣϯΛషΔͷ·Ͱ͕͔͔࣌ؒΔ͜ͱ͕͋Δ ϝοηʔδૹड৴࣌ͷԆ΄ͱΜͲײ͡ͳ͍͕ɺࢀՃਓωοτ ϫʔΫڥʹେ͖͘ґଘ͢ΔͱࢥΘΕΔ FaceTimeͷάϧʔϓ௨࠷େ32ਓ͕ͩɺGroup ActivitiesͰԿਓ·Ͱ αϙʔτ͢Δͷ͔ෆ໌ɻ
Environment Tips ಉ͡FaceTimeΞΧϯτʴෳͷσόΠεͰFaceTime SessionΛ࡞ͬͯ ͏·͍͔͘ͳ͍߹͕͋Δɻ WWDCͷϓϨθϯͰ͏·͍͍ͬͯ͘ΔΑ͏ʹݟ͑·͕ͨ͠ɺखݩͰ ͏·͍͖͘·ͤΜͰͨ͠ɻ ։ൃ༻ʹผFaceTimeΞΧϯτΛ༻ҙͨ͠ํ͕҆શɻ
Environment Tips Group ActivitiesରԠΞϓϦͷTestFlightͰͷɺݱ࣌Ͱαϙʔτ ͞Ε͍ͯ·ͤΜɻ Group ActivitiesͷΞϓϦͰɺGroupAcͰඞཁͳ com.apple.developer.group-sessionͷcode signing entitlement͕ඞཁͰ
͕͢ɺͦΕΛద༻͢ΔͱiTunes connectͰͷΞοϓϩʔυ࣌ʹΤϥʔ͕ ൃੜ͠·͢ɻ
·ͱΊ Custom ActivitiesɺάϧʔϓηογϣϯΛ؆୯ʹ࣮Ͱ͖Δͷ͕ັྗ తɻ ͨͩ͠ɺ։ൃڥΛ༻ҙ͢Δͷ͕গ͠େม͔ɻ iOS15͕ෳ͋ͬͨΒࢼͯ͠Έ·͠ΐ͏ɻ
More Decks by Tachibana Kaoru
See All by Tachibana Kaoru
GeoLocationAnchor and MKTileOverlay
toyship
0
430
Synchronized iPhones, Again!
toyship
2
1.7k
ARKit4.pdf
toyship
1
2.4k
Custom Gesture Recognizer on iOS
toyship
3
1.5k
HEVC Video with Alpha Channel
toyship
1
1.3k
RealityKit & Reality Composer
toyship
3
710
ARKit3
toyship
4
7.7k
UIViewPropertyAnimator and Easing
toyship
2
1.2k
Synchronized iPhones!
toyship
3
5.1k
Other Decks in Technology
See All in Technology
Kansai WordPress Meetup@大阪『ブロックテーマを作る上で知っておくべきこと
torounit
0
250
会社説明資料_最新版
demaecan
0
32k
個人ASを取得して、自宅Kubernetes上のVMをグローバルIPで公開した話
munenick
0
210
変更差分を読むために環境を整備しよう
pipepasta
1
470
RAGの改善を速く回すための評価基盤
yosukeyoshida
6
3.2k
自動計装なしでECSサービスをApplication Signalsに載せるまで
ota1022
2
400
3文字略語に騙されない! 世界一わかりやすい『EDR』超入門
kamadamakoto
1
270
さようならSSH鍵、こんにちはゼロトラスト ― AIフレンドリーで快適な自宅鯖SSH
atalie2m
14
7.1k
CloudTrail を推したい
kazzpapa3
1
140
SREのためのFinOps入門
muziyoshiz
3
1.6k
Frontier Teams — Amazon は AI で「開発のやり方」をどう変えたのか
kmotohas
0
300
統制されたID・権限をどう利用するか : DPoP/FAPIによるAPIセキュリティ強化
oidfj
1
140
Featured
See All Featured
Chasing Engaging Ingredients in Design
codingconduct
0
400
Have SEOs Ruined the Internet? - User Awareness of SEO in 2025
akashhashmi
0
550
The Hidden Cost of Media on the Web [PixelPalooza 2025]
tammyeverts
2
580
Odyssey Design
rkendrick25
PRO
3
950
Claude Code どこまでも/ Claude Code Everywhere
nwiizo
68
60k
GitHub's CSS Performance
jonrohan
1033
470k
Automating Front-end Workflow
addyosmani
1370
210k
Effective software design: The role of men in debugging patriarchy in IT @ Voxxed Days AMS
baasie
1
610
Reality Check: Gamification 10 Years Later
codingconduct
0
2.4k
Speed Design
sergeychernyshev
33
2.2k
Taking LLMs out of the black box: A practical guide to human-in-the-loop distillation
inesmontani
PRO
3
2.5k
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
47
8.4k