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
150
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
250
Custom Group Activities
toyship
3
1.2k
Synchronized iPhones, Again!
toyship
2
1.3k
ARKit4.pdf
toyship
1
2k
Custom Gesture Recognizer on iOS
toyship
3
1.1k
HEVC Video with Alpha Channel
toyship
1
990
RealityKit & Reality Composer
toyship
3
400
ARKit3
toyship
5
6.8k
UIViewPropertyAnimator and Easing
toyship
2
820
Other Decks in Programming
See All in Programming
코틀린으로 멀티플랫폼 만들기
pangmoo
0
120
脱・初心者!脱・マネコン!AWS CDKを使ってみませんか!?
har1101
0
300
ゆるい個人開発のススメ
kuroppe1819
10
950
Javaエンジニアのための Nodejs/Nuxt3入門
hidekatsu_izuno
0
280
puregoの活用例
aethiopicuschan
0
220
Ruby製社内ツールのGo移行
bgpat
2
330
OpenAPIを中心に考えるAPI開発入門 / Introduction to API Development with a Focus on OpenAPI
seike460
PRO
2
120
SpringBoot+MyBatisで例外が出たときどこを見るか
syukai
0
110
ADRを一年運用してみた/adr_after_a_year
hanhan1978
7
2.2k
TYPO3 v13 – The road to LTS: What's new and new APIs
luisasofie_xoxo
0
180
スクラムガイドのスプリントレトロスペクティブを改めて読みかえしてみた / Re-reading the Sprint Retrospective Section in the Scrum Guide
mackey0225
3
330
GitHub Actionsで泣かないためにやっておきたい設定 / Recommended GHA settings to avoid crying
pinkumohikan
3
490
Featured
See All Featured
Optimising Largest Contentful Paint
csswizardry
7
2.3k
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
5
1.5k
Building an army of robots
kneath
300
41k
What's new in Ruby 2.0
geeforr
337
31k
Robots, Beer and Maslow
schacon
PRO
155
7.9k
Designing Experiences People Love
moore
136
23k
The World Runs on Bad Software
bkeepers
PRO
61
6.7k
Mobile First: as difficult as doing things right
swwweet
216
8.6k
Building Your Own Lightsaber
phodgson
98
5.7k
Raft: Consensus for Rubyists
vanstee
132
6.2k
Unsuck your backbone
ammeep
662
57k
Documentation Writing (for coders)
carmenintech
59
3.9k
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ͷόʔδϣϯ ʹΑͬͯಈ࡞͕ҟͳΔ͜ͱʹҙ