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
190
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
340
Custom Group Activities
toyship
3
1.4k
Synchronized iPhones, Again!
toyship
2
1.5k
ARKit4.pdf
toyship
1
2.2k
Custom Gesture Recognizer on iOS
toyship
3
1.4k
HEVC Video with Alpha Channel
toyship
1
1.2k
RealityKit & Reality Composer
toyship
3
620
ARKit3
toyship
4
7.4k
UIViewPropertyAnimator and Easing
toyship
2
1.1k
Other Decks in Programming
See All in Programming
Go言語はstack overflowの夢を見るか?
logica0419
0
660
CSC305 Lecture 11
javiergs
PRO
0
320
TransformerからMCPまで(現代AIを理解するための羅針盤)
mickey_kubo
7
5.8k
業務でAIを使いたい話
hnw
0
210
CSC509 Lecture 08
javiergs
PRO
0
270
KoogではじめるAIエージェント開発
hiroaki404
1
210
퇴근 후 1억이 거래되는 서비스 만들기 | 내가 AI를 사용하는 방법
maryang
1
150
スキーマ駆動で、Zod OpenAPI Honoによる、API開発するために、Hono Takibiというライブラリを作っている
nakita628
0
330
React Nativeならぬ"Vue Native"が実現するかも?_新世代マルチプラットフォーム開発フレームワークのLynxとLynxのVue.js対応を追ってみよう_Vue Lynx
yut0naga1_fa
2
1.9k
iOSでSVG画像を扱う
kishikawakatsumi
0
180
ボトムアップの生成AI活用を推進する社内AIエージェント開発
aku11i
0
1.3k
ビルドプロセスをデバッグしよう!
yt8492
0
160
Featured
See All Featured
Embracing the Ebb and Flow
colly
88
4.9k
Leading Effective Engineering Teams in the AI Era
addyosmani
7
680
VelocityConf: Rendering Performance Case Studies
addyosmani
333
24k
[RailsConf 2023] Rails as a piece of cake
palkan
57
6k
How to train your dragon (web standard)
notwaldorf
97
6.3k
How To Stay Up To Date on Web Technology
chriscoyier
791
250k
Large-scale JavaScript Application Architecture
addyosmani
514
110k
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
253
22k
Six Lessons from altMBA
skipperchong
29
4k
The Power of CSS Pseudo Elements
geoffreycrofte
80
6k
How to Ace a Technical Interview
jacobian
280
24k
Testing 201, or: Great Expectations
jmmastey
46
7.7k
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ͷόʔδϣϯ ʹΑͬͯಈ࡞͕ҟͳΔ͜ͱʹҙ