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
Universal Link on iOS
Search
Tachibana Kaoru
April 27, 2016
Programming
1
180
Universal Link on iOS
Tachibana Kaoru
April 27, 2016
Tweet
Share
More Decks by Tachibana Kaoru
See All by Tachibana Kaoru
GeoLocationAnchor and MKTileOverlay
toyship
0
290
Custom Group Activities
toyship
3
1.3k
Synchronized iPhones, Again!
toyship
2
1.4k
ARKit4.pdf
toyship
1
2.1k
Custom Gesture Recognizer on iOS
toyship
3
1.3k
HEVC Video with Alpha Channel
toyship
1
1.1k
RealityKit & Reality Composer
toyship
3
490
ARKit3
toyship
4
7k
UIViewPropertyAnimator and Easing
toyship
2
940
Other Decks in Programming
See All in Programming
初めてDefinitelyTypedにPRを出した話
syumai
0
410
受け取る人から提供する人になるということ
little_rubyist
0
230
What’s New in Compose Multiplatform - A Live Tour (droidcon London 2024)
zsmb
1
470
NSOutlineView何もわからん:( 前編 / I Don't Understand About NSOutlineView :( Pt. 1
usagimaru
0
340
Enabling DevOps and Team Topologies Through Architecture: Architecting for Fast Flow
cer
PRO
0
330
みんなでプロポーザルを書いてみた
yuriko1211
0
260
3rd party scriptでもReactを使いたい! Preact + Reactのハイブリッド開発
righttouch
PRO
1
600
cmp.Or に感動した
otakakot
3
170
TypeScriptでライブラリとの依存を限定的にする方法
tutinoko
2
670
AWS IaCの注目アップデート 2024年10月版
konokenj
3
3.3k
ふかぼれ!CSSセレクターモジュール / Fukabore! CSS Selectors Module
petamoriken
0
150
レガシーシステムにどう立ち向かうか 複雑さと理想と現実/vs-legacy
suzukihoge
14
2.2k
Featured
See All Featured
Done Done
chrislema
181
16k
Being A Developer After 40
akosma
86
590k
Optimising Largest Contentful Paint
csswizardry
33
2.9k
How to Ace a Technical Interview
jacobian
276
23k
Become a Pro
speakerdeck
PRO
25
5k
BBQ
matthewcrist
85
9.3k
Building Better People: How to give real-time feedback that sticks.
wjessup
364
19k
KATA
mclloyd
29
14k
Visualization
eitanlees
145
15k
Building a Scalable Design System with Sketch
lauravandoore
459
33k
Bash Introduction
62gerente
608
210k
Documentation Writing (for coders)
carmenintech
65
4.4k
Transcript
Universal Link 2016/04/20 @TachibanaKaoru
ࣗݾհ ौ୩ͷVOYAGE GROUPͰiOSΤϯδχ ΞΛ͍ͯ͠·͢ɻ Twitter/Vainglory : @TachibanaKaoru Blog : http://www.toyship.org/
Bouldering : 4ڃ ே࣌ؒ.jpͱ͍͏ΞϓϦΛͩͯ͠·͢ɻ
Universal Linkͱ from iOS9 » ࣗͷΞϓϦଞͷΞϓϦΛىಈ͢ΔεΩʔϜɻ » iOS෦ͷʢઃఆͨ͠ʣURL Link͔ΒΞϓϦΛىಈ͢Δ͜ͱ͕Ͱ͖ Δɻ
» ࠓ·ͰͷΧελϜURLεΩʔϜΛ͓͖͔͑Δػೳɻ » URL Schemeͷ߹ʹͦΕͧΕͷΞϓϦ͕͖ͳͷΛઃఆͰ͖Δ ͷͰɺΞϓϦؒͷॏෳͷةݥੑ͕͕͋ͬͨɺUniversal Linkͷ߹ʹ ɺDomain໊ʹґଘ͢ΔͨΊɺҰҙੑ͕୲อͰ͖Δɻ
Universal Link from Memo
Universal Link from Mail
Universal Link ΞϓϦ͕Πϯετʔϧ͞Ε͍ͯΔ߹ɺ ΞϓϦͰ։͘ɻ
Universal Link ΞϓϦ͕Πϯετʔϧ͞Ε͍ͯͳ͍ ߹ɺMobile SafariͰ։͘ɻ
ଞͷΞϓϦ͔Βͷ Universal Link » openURLͰىಈͨ͠߹ʹɺUniversal Link͕༗ޮʹͳΓ·͢ɻ » ͨͩ͠ɺurlΛ։͘ࡍʹSFSafariViewControllerɺWKWebViewɺ UIWebViewΛ͏ͱUniversal LinkແޮʹͳΓ·͢ɻ
» ҙࣝͷߴ͍ΞϓϦͩΊɻ
ࣗͷΞϓϦ͔Βͷ Universal Link ࣗͷΞϓϦ͔ΒopenURLΛͯ͠Universal Link͕༗ޮʹͳΓ· ͤΜɻʢMobile SafariͰ։͘ʣ
Mobile Safari͔Β » Mobile SafariͷΞυϨεόʔʹURLΛೖྗͨ͠߹ɺMobile SafariͷϦϯΫ͔ΒҠಈͨ͠߹ʹUniversal Link͖͖·ͤ Μɻ » GoogleͳͲͷݕࡧ݁Ռ͔ΒUniversal
Link͕༗ޮʹͳΓ·͢ɻ
ϢʔβʔͷબΛอଘ » ΞϓϦͰ։͔͘ɺMobile SafariͰ։͔͘બͰ͖Δػೳ͕͋Δɻ
ϢʔβʔͷબΛอଘ Mobile SafariͰUniversal LinkରԠͷ ϦϯΫΛݕࡧ݁Ռʹදࣔͯ͠ΈΔɻ
ϢʔβʔͷબΛอଘ Ұ୴Universal Linkͱͯ͠ΞϓϦͰ ։͔ΕΔ͕ɺӈ্ʹSafariͷϦϯΫΛ දࣔ͢Δɻ
ϢʔβʔͷબΛอଘ SafariͷϦϯΫΛબ͢ΔͱSafariͰ ։͖ɺҎޙSafariͰ։͘Α͏ʹͳΔɻ
Smart App Bannerͱͷҧ͍ » Universal LinkɺSmart App Bannerͱత͕ҟͳΔͨΊɺ྆ ํ࣮͢Δඞཁ͕͋Γ·͢ɻ »
Smart App BannerͰɺΞϓϦ͕Πϯετʔϧ͞Ε͍ͯͨΒΞϓϦ ͕ىಈ͞ΕɺΞϓϦ͕Πϯετʔϧ͞Ε͍ͯͳ͔ͬͨΒApp Store͕ ىಈ͢Δɻ <meta name="apple-itunes-app" content="app-id=400435286, app-argument=https://asajikan.jp/topics/">
Smart App BannerͱUniversal LinkͷӅΕ ͨؔ » Smart App Bannerͷcontentͷapp-argumentࢦఆ͕Universal LinkʹରԠ͍ͯ͠Δ͔Ͳ͏͔ͰUI͕มΘΔɻʢԼهͷϦϯΫΛ
Mobile SafariͰνΣοΫͯ͠Έ͍ͯͩ͘͞ʣ » https://asajikan.jp/ (Universal LinkରԠ) » https://asajikan.jp/topics/ (Universal LinkඇରԠ)
Smart App Banner Universal LinkରԠͷ߹ɺΞϓϦͰ Universal Linkͱͯ͠։͘ɻʢBanner খ͞Ίʣ
Smart App Banner Universal LinkରԠͷ߹ɺΞϓϦͷ τοϓΛ։͘ɻʢBannerେ͖Ίʣ
࣮ํ๏ » Server » Client
࣮ํ๏ (Server) » server root(/)ʹ apple-app-site-association ͱ͍͏໊শͰjson ϑΥʔϚοτͷઃఆϑΝΠϧΛஔ͘ɻ » ʢ͜ͷϑΝΠϧʹॺ໊Λ͔͚Δඞཁ͕͋Δͱ͍͏ใ͕͚͋ͬͨ
Ͳɺ͔͚Δඞཁ͋Γ·ͤΜɻʣ » iOS9.3.1Ҏ্Ͱɺapple-app-site-associationͷϑΝΠϧαΠζ 128KBʹ੍ݶ͞Εͯ·͢ɻ(9.3Ͱൃੜ͍ͯͨ͠ΫϥογϡͷݪҼ ͩͬͨΒ͍͠)
apple-app-site-association format » Bundle IdentifierͱUniversal LinkʹରԠ͍ͤͨ͞pathΛهड़ɻ { "applinks": { "apps":
[], "details": [ { "appID": "9JA89QQLNQ.com.apple.wwdc", "paths": [ "/wwdc/news/", "/videos/wwdc/2015/*"] }, { "appID": "ABCD1234.com.apple.wwdc", "paths": [ "*" ] } ] } }
࣮ํ๏ (Server) » ઃఆϑΝΠϧͷஔ͖ॴɺ9.3͔Β /.well-known/ αϙʔτ͢Δ Α͏ʹͳΓ·ͨ͠ɻ » Technical Q&A
QA1919 » Incoming requests for /.well-known/apple-app-site- association file https://developer.apple.com/library/ios/qa/qa1919/ index.html#//appleref/doc/uid/DTS40016874
apple-app-site-association format asajikan.jpͷݱࡏͷઃఆ { "applinks": { "apps": [], "details": [
{ "appID": "94VJUJ8B7P.jp.asajikan.www", "paths": [ "/", "/article/*", "/recipe/*" ] } ] } }
apple-app-site-association format » ࣮ɺࠓͷϑΥʔϚοτҎલʹΘΕ͍ͯͨݹ͍ϑΥʔϚοτ͋Γ ·͢ɻʢͦͷ͏ͪແޮʹͳΔͱࢥ͏ͷͰΘͳ͍΄͏͕Α͍ʣ { "applinks": { "apps": [],
"details": { "94VJUJ8B7P.jp.asajikan.www": { "paths": [ "/", "/article/*", "/recipe/*" ] } } } }
apple-app-site-association format » ?͕Ұจࣈɺ*͕ෳจࣈ » NOTΛͬͯର֎pathͷઃఆͰ͖Δ͕ɺݹ͍iOSͰඇରԠ ʢ9.2.1ͰOKɺ9.1ͰNGʣ » "paths": [
"/wwdc/news/", "NOT /videos/wwdc/2010/", "/ videos/wwdc/201?/"] » ͜͏͢Δͱɺwwdc/201*/ҎԼͷϑΝΠϧwwdc/2010Λͷ͍ͧ ͯUniversal LinkରԠͱͳΔɻ
App Search API Validation Tool » formatͷvalidation checkΛ͢Δ͜ͱ͕Ͱ͖·͢ɻ » https://search.developer.apple.com/appsearch-validation-
tool
None
࣮ํ๏ (Client) » ProjectͷCapabilityʹAssociated DomainsΛઃఆ » ྫʣDomains: applinks:asajikan.jp
None
࣮ํ๏ (Client) » ىಈ͞Εͨ࣌ͷϋϯυϦϯάॲཧ » UIApplicationDelegate » application:continueUserActivity:restorationHandler: » ʢCore
SearchHandoffʹΑΔىಈϋϯυϦϯά͢Δʣ
func application(application: UIApplication, continueUserActivity userActivity: NSUserActivity, restorationHandler: ([AnyObject]?) -> Void)
-> Bool{ if userActivity.activityType == "com.apple.corespotlightitem" { // Core SearchͷॲཧΛهड़ } else if userActivity.activityType == NSUserActivityTypeBrowsingWeb { let url : NSURL? = userActivity.webpageURL // Universal LinkͷॲཧΛهड़ } return true }
·ͱΊ » Web Site࿈ܞΞϓϦUniversal Linkಋೖ͖͢ » Smart App Banner࿈ܞͤ͞Δͱϕλʔ »
Universal LinkରԠpathࡉ͔͘ઃఆͰ͖Δ͕ɺiOSͷόʔδϣϯ ʹΑͬͯಈ࡞͕ҟͳΔ͜ͱʹҙ