iOS

[ iOS ] Link Presentation ์•Œ์•„๋ณด๊ธฐ

Forest Yun 2023. 8. 18. 22:55
728x90

 

 

Link Presentation | Apple Developer Documentation

Fetch, provide, and present rich links in your app.

developer.apple.com

 
 

๐ŸŽฌ ๊ธ€์„ ์‹œ์ž‘ํ•˜๋ฉฐ

Link Presentation์€ <์•ผ๊ธฐ> ์•ฑ์„ ๊ฐœ๋ฐœํ•  ๋•Œ ์‚ฌ์šฉํ–ˆ๋˜ Framework๋กœ, Share Sheet๋ฅผ ์ž„์˜๋กœ ๊ตฌ์„ฑํ•˜๊ธฐ ์œ„ํ•ด ์‚ฌ์šฉํ–ˆ๋‹ค. ํ•˜์ง€๋งŒ title๊ณผ content๋งŒ์œผ๋กœ ๊ตฌ์„ฑํ–ˆ๊ธฐ ๋•Œ๋ฌธ์— ์ด framework๋ฅผ ์ž˜ ์‚ฌ์šฉํ–ˆ๋‹ค๊ณ  ํ•˜๊ธด ์–ด๋ ต๋‹ค. ์ด๋ฒˆ์— <WanF> ํ”„๋กœ์ ํŠธ์—์„œ ๋ชจ์ž„ ์ •๋ณด๋ฅผ ๊ณต์œ ํ•  ๋•Œ ๋งํฌ๋ฅผ ์ฒจ๋ถ€ํ•˜๊ธฐ ์œ„ํ•ด Link Presentation๋ฅผ ์‚ฌ์šฉํ•  ์˜ˆ์ •์ด๋‹ค. ๊ทธ ์ „์— ๊ณต์‹ ๋ฌธ์„œ์™€ WWDC ์˜์ƒ์„ ํ†ตํ•ด Link Presentation์„ ๊ผผ๊ผผํ•˜๊ฒŒ ์ •๋ฆฌํ•˜๋ ค ํ•œ๋‹ค.
 
 
 
 

โœ‰๏ธ Link Presentationd์ด๋ž€?

๋‚ด์šฉ์ด ํ’๋ถ€ํ•œ URL ๋งํฌ๋ฅผ ์ด๋ฏธ์ง€ ๋˜๋Š” ๋™์˜์ƒ๊ณผ ํ•จ๊ป˜ ์ผ๊ด€๋œ ๋ฐฉ์‹์œผ๋กœ ์•ฑ์— ๊ฐ€์ ธ์˜ค๊ณ  ์ œ๊ณตํ•˜๊ณ  ๋ณด์—ฌ์ฃผ๋Š” ๊ฒƒ์ด๋‹ค. ์ด ํ”„๋ ˆ์ž„์›Œํฌ๋Š” URL๋กœ๋ถ€ํ„ฐ ๋ฉ”ํƒ€๋ฐ์ดํ„ฐ๋ฅผ ๊ฒ€์ƒ‰ํ•˜๊ณ  ์•ฑ์— ๋งํฌ์˜ ๋‚ด์šฉ์„ ํ‘œ์‹œํ•œ๋‹ค. ๊ทธ๋ฆฌ๊ณ  Share Sheet ํ™˜๊ฒฝ์— ๋งํฌ ๋ฉ”ํƒ€๋ฐ์ดํ„ฐ๋ฅผ ์ œ๊ณตํ•œ๋‹ค.

๋ฉ”ํƒ€ ๋ฐ์ดํ„ฐ: ๋ฐ์ดํ„ฐ์— ๋Œ€ํ•œ ๊ตฌ์กฐํ™”๋œ ๋ฐ์ดํ„ฐ. ์˜ํ™”๋ฅผ ๋ณด๊ธฐ ์œ„ํ•ด DVD ํƒ€์ดํ‹€์„ ๊ตฌ๋งคํ–ˆ์„ ๋•Œ ํฌ์žฅ์— ๋ถ™์–ด์žˆ๋Š” ์ œ๋ชฉ, ์ƒ์˜์‹œ๊ฐ„, ๊ฐ๋… ๋“ฑ์ด ๋ฉ”ํƒ€๋ฐ์ดํ„ฐ์ด๋‹ค.

 
AppStore์—์„œ ์•ฑ์„ ๊ณต์œ ํ•˜๋Š” ๋“ฑ ๋‹ค๋ฅธ ์‚ฌ์šฉ์ž์—๊ฒŒ ๋ฌด์–ธ๊ฐ€๋ฅผ ๊ณต์œ ํ•  ๋•Œ ์œ„์™€ ๊ฐ™์€ ๋ชจ์–‘์„ ๋งŽ์ด ๋ณด์•˜์„ ๊ฒƒ์ด๋‹ค. ์ด๊ฒƒ์„ Rich Link Message๋ผ ๋ถ€๋ฅด๋ฉฐ Link Presentation์„ ํ†ตํ•ด ๋งŒ๋“ค ์ˆ˜ ์žˆ๋‹ค. ์ด ๋ฉ”์„ธ์ง€๋Š” ์•„๋ž˜์™€ ๊ฐ™์ด 3๊ฐ€์ง€ ๋ชจ์–‘์ด ์žˆ๋‹ค.

 
 
 
 

๐Ÿ‘ฉ๐Ÿป‍๐Ÿ’ป Embedding and Sharing Visually Rich Links

Link Presentation์€ WWDC 2019์—์„œ ์†Œ๊ฐœ๋˜์—ˆ๋‹ค. ๊ธฐ์กด Apple์€ iOS 10๊ณผ macOS Sierra์—์„œ URL์„ ์•„๋ฆ„๋‹ต๊ณ  ๋” ์œ ์šฉํ•˜๊ฒŒ ๋งŒ๋“œ๋Š” ๋ฉ”์„ธ์ง€๋กœ Rich Links๋ฅผ ์†Œ๊ฐœํ–ˆ๋‹ค. ์ดํ›„ Apple์€ iOS 13๊ณผ macOS 10.15์—์„œ ์ตœ์†Œํ•œ์˜ ์ž‘์—…๋งŒ์œผ๋กœ๋„ ๊ฐ™์€ ์ด์ ์„ ์ œ๊ณตํ•˜๋Š” Link Presentation framework๋ฅผ ์†Œ๊ฐœํ–ˆ๋‹ค.

 

Embedding and Sharing Visually Rich Links - WWDC19 - Videos - Apple Developer

The new Link Presentation framework enables app developers to easily present URLs in a rich, beautiful, and consistent way. Learn how to...

developer.apple.com

 
์œ„ ๊ณต์‹ ์˜์ƒ์—์„œ๋Š” 3๊ฐ€์ง€ ์ฃผ์ œ๋กœ ๋‚˜๋ˆ„์–ด Link Presentation ํ”„๋ ˆ์ž„์›Œํฌ๋ฅผ ์‚ฌ์šฉํ•œ ์˜ˆ์‹œ๋ฅผ ๋ณด์—ฌ์ฃผ์—ˆ๋‹ค. ์ด ์˜ˆ์‹œ๋ฅผ ์ •๋ฆฌํ•˜๋ฉฐ Link Presentation์„ ์•Œ์•„๋ณด๊ณ ์ž ํ•œ๋‹ค.
1. How to present metadata given a URL (์ฃผ์–ด์ง„ URL์˜ ๋ฉ”ํƒ€๋ฐ์ดํ„ฐ๋ฅผ ํ‘œ์‹œํ•˜๋Š” ๋ฐฉ๋ฒ•)
2. How to easily present that metadata to the users (๋ฉ”ํƒ€๋ฐ์ดํ„ฐ๋ฅผ ์‚ฌ์šฉ์ž์—๊ฒŒ ์‰ฝ๊ฒŒ ํ‘œ์‹œํ•˜๋Š” ๋ฐฉ๋ฒ•)
3. How to use fetched metadata to accelerate the presentation of the new Share Sheet experience in iOS 13 (iOS 13์—์„œ ์ƒˆ๋กœ์šด Share Sheet ํ™˜๊ฒฝ์˜ presentation์„ ๊ฐ€์†ํ™”ํ•˜๊ธฐ ์œ„ํ•ด ๊ฐ€์ ธ์˜จ ๋ฉ”ํƒ€๋ฐ์ดํ„ฐ๋ฅผ ์‚ฌ์šฉํ•˜๋Š” ๋ฐฉ๋ฒ•)
 
 
 

1๏ธโƒฃ Retrieving metadata

๋ฌธ์ž์—ด๋กœ URL์„ ๊ฐ„๋‹จํžˆ ๋ณด์—ฌ์ค„ ์ˆ˜๋„ ์žˆ์ง€๋งŒ, URL์€ ์‚ฌ์šฉ์ž ์นœํ™”์ ์ด์ง€ ์•Š์•„ ์—ฌ๋Ÿฌ URL์ด ์žˆ์„ ๊ฒฝ์šฐ ๊ตฌ๋ถ„ํ•˜๊ธฐ ์–ด๋ ต๋‹ค. ์‚ฌ์šฉ์ž์—๊ฒŒ URL์˜ title์„ ์š”๊ตฌํ•  ์ˆ˜๋„ ์žˆ์ง€๋งŒ Link Presentation์„ ์‚ฌ์šฉํ•˜๋ฉด ๋” ์‰ฝ๊ฒŒ ์‚ฌ์šฉ์ž ์นœํ™”์ ์ธ URL์„ ๊ตฌ์„ฑํ•  ์ˆ˜ ์žˆ๋‹ค.
์ƒˆ๋กœ์šด Link Presentation ํ”„๋ ˆ์ž„์›Œํฌ๋ฅผ ์‚ฌ์šฉํ•˜๋ฉด LP metadata provider ํด๋ž˜์Šค๋ฅผ ์‚ฌ์šฉํ•˜์—ฌ ์›น์‚ฌ์ดํŠธ๋กœ๋ถ€ํ„ฐ ํ’๋ถ€ํ•œ ๋ฉ”ํƒ€๋ฐ์ดํ„ฐ๋ฅผ ์‰ฝ๊ฒŒ ์–ป์„ ์ˆ˜ ์žˆ๋‹ค. ์ด ํด๋ž˜์Šค์— URL์„ ์ „๋‹ฌํ•˜๋ฉด ์‚ฌ์šฉ ๊ฐ€๋Šฅํ•œ ๋ชจ๋“  ๋ฏธ๋””์–ด์—์„œ ๋Œ€ํ‘œ title๊ณผ ํ•จ๊ป˜ LPLinkMetadata ๊ฐ์ฒด๋ฅผ ๋ฐ˜ํ™˜ํ•œ๋‹ค. 

 
๋จผ์ € LPMetadataProvider ๋ฅผ ์ƒ์„ฑํ•œ ํ›„ startFetchingMetadata๋ฅผ URL๊ณผ ํ•จ๊ป˜ ํ˜ธ์ถœํ•˜๋ผ. completion handler๊ฐ€ ํ˜ธ์ถœ๋  ๋•Œ ์—๋Ÿฌ๋ฅผ ํ™•์ธํ•  ์ˆ˜ ์žˆ๋Š”๋ฐ, ๋งŒ์•ฝ ์„œ๋ฒ„๊ฐ€ ์‘๋‹ตํ•˜์ง€ ์•Š๊ฑฐ๋‚˜ ๋˜๋Š” ๋„ˆ๋ฌด ๋Š๋ฆฌ๊ฑฐ๋‚˜ ์‚ฌ์šฉ์ž์˜ ๋„คํŠธ์›Œํฌ๊ฐ€ ์—ฐ๊ฒฐ๋˜์ง€ ์•Š์•˜๋‹ค๋ฉด ๋ฉ”ํƒ€๋ฐ์ดํ„ฐ๋ฅผ ๊ฐ€์ ธ์˜ค๋Š” ๊ฒƒ์€ ์‹คํŒจํ•  ์ˆ˜๋„ ์žˆ๋‹ค. ๋งˆ์ง€๋ง‰์œผ๋กœ ์šฐ๋ฆฌ๊ฐ€ ์›ํ•˜๋Š” ๋Œ€๋กœ ๋ฉ”ํƒ€๋ฐ์ดํ„ฐ๋ฅผ ์‚ฌ์šฉํ•˜๋ฉด ๋œ๋‹ค.

// Fetch metadata from a given URL

let metadataProvider = LPMetadataProvider()
let url = URL(string: "https://www.apple.com/ipad")!


metadataProvider.startFetchingMetadata(for: url) { metadata, error in
    if error != nil {
        // The fetch failed; handle the error.
        return
    }


    // Make use of fetched metadata.
}

 
metadataProvider์™€ LinkMetadata๋ฅผ ์‚ฌ์šฉํ•  ๋•Œ ๋ช‡ ๊ฐ€์ง€ ์ฃผ์˜ํ•ด์•ผ ํ•œ๋‹ค. ๋งŒ์•ฝ ์‚ฌ์ดํŠธ๊ฐ€ ์–ด๋–ค ๊ฒƒ๋„ ์ง€์ •ํ•˜์ง€ ์•Š์•˜์ž๋ฉด ๊ฒฐ๊ณผ๋กœ ๋‚˜์˜จ ๋ฉ”ํƒ€๋ฐ์ดํ„ฐ ๊ฐ์ฒด๊ฐ€ title, icon, image๋‚˜ video ๋˜๋Š” ๊ทธ ๋ฌด์–ธ๊ฐ€๋„ ํฌํ•จํ•˜์ง€ ์•Š์„ ์ˆ˜ ์žˆ๋‹ค. ๊ทธ๋ฆฌ๊ณ  ๊ทธ ๋ฉ”ํƒ€๋ฐ์ดํ„ฐ ๊ฐ์ฒด๋Š” secure coding ์†์—์„œ ์ง๋ ฌํ™”(serializable)๋  ์ˆ˜ ์žˆ๋‹ค. ์ด๋Š” LPMetadataProvider๊ฐ€ ๊ทธ ์ž‘์—…์„ ์ˆ˜ํ–‰ํ•˜๊ธฐ ์œ„ํ•ด ์ธํ„ฐ๋„ท์— ๋„๋‹ฌํ•˜๊ณ , ์‚ฌ์šฉ์ž๊ฐ€ ๊ทธ ์ž‘์—…์„ ์ˆ˜ํ–‰ํ•˜๊ณ  ๋งค๋ฒˆ ์šฐ๋ฆฌ์—๊ฒŒ ๊ฐ™์€ link๋ฅผ ๋ณด์—ฌ์ค„ ๋•Œ๋งˆ๋‹ค ๋ฐ์ดํ„ฐ์™€ ์ˆ˜ํ–‰ ๋น„์šฉ์„ ์ง€๋ถˆํ•˜๊ฒŒ ํ•˜๊ณ  ์‹ถ์ง€ ์•Š๊ธฐ ๋•Œ๋ฌธ์— ์ค‘์š”ํ•˜๋‹ค. ๋”ฐ๋ผ์„œ ์–ป์–ด๋‚ธ ๋ฉ”ํƒ€๋ฐ์ดํ„ฐ๋ฅผ ๊ฐ€๋Šฅํ•œ ๋กœ์ปฌ๋กœ cache ํ•ด์•ผํ•œ๋‹ค.

์ง๋ ฌํ™”: ๋ฐ์ดํ„ฐ ๊ตฌ์กฐ๋‚˜ ๊ฐ์ฒด์˜ ์ƒํƒœ๋ฅผ ์ถ”ํ›„ ์ €์žฅํ•  ์ˆ˜ ์žˆ๊ฑฐ๋‚˜ ์ „์†ก๋  ์ˆ˜ ์žˆ๋Š”, ๋˜๋Š” ์žฌ๊ตฌ์„ฑํ•  ์ˆ˜ ์žˆ๋Š” ํ˜•์‹์œผ๋กœ ๋ณ€ํ™˜ํ•˜๋Š” ๊ณผ์ •์ด๋‹ค.
 

๋˜ํ•œ ๋ฉ”ํƒ€๋ฐ์ดํ„ฐ๋ฅผ ๋กœ์ปฌ file URL์—์„œ ๊ฐ€์ ธ์˜ฌ ์ˆ˜ ์žˆ๋‹ค. ์ด๋Ÿฐ ๊ฒฝ์šฐ์—๋Š” ๋งŒ์•ฝ ๊ฐ€๋Šฅํ•˜๋‹ค๋ฉด ํŒŒ์ผ์— ๋Œ€ํ•œ ๋Œ€ํ‘œ ์ธ๋„ค์ผ์„ ์–ป๊ธฐ ์œ„ํ•ด ์ƒˆ๋กœ์šด QuickLook thumbnailing API๊ฐ€ ์‚ฌ์šฉ๋˜์–ด์งˆ ๊ฒƒ์ด๋‹ค.
 
 
 
 
 

2๏ธโƒฃ Presenting links

์šฐ๋ฆฌ๊ฐ€ ์–ป์€ ๋ฉ”ํƒ€๋ฐ์ดํ„ฐ๋ฅผ ์•ฑ์— presentํ•˜๋Š” ๋ฐฉ๋ฒ•์€ ๊ฐ„๋‹จํ•˜๋‹ค. ๋ฐ”๋กœ ์•ž์—์„œ ๋งŒ๋“  ๊ฐ์ฒด๋กœ LPLinkView๋ฅผ ๋งŒ๋“ค ์ˆ˜ ์žˆ๋‹ค.

// Present LPLinkMetadata in a LPLinkView

let linkView = LPLinkView(metadata: metadata)
cell.contentView.addSubview(linkView)
linkView.sizeToFit()

LPLinkView๋Š” ๊ณ ์œ ์˜ size๋ฅผ ๊ฐ€์ง€๊ณ  ์žˆ์ง€๋งŒ, ๊ทธ๊ฒƒ์€ ๋˜ํ•œ ์ œํ•œ๋œ size๊ฐ€ ์ฃผ์–ด์ง€๋ฉด ์ด๋ฅผ ์‚ฌ์šฉํ•˜๊ธฐ ์œ„ํ•ด ์ด์ƒ์ ์ธ ํฌ๊ธฐ์— ๋งž๋Š” size๋ฅผ ์‚ฌ์šฉํ•  ์ˆ˜ ์žˆ๋‹ค. ๊ทธ๋ฆฌ๊ณ  ์–ด๋–ค size๋กœ ํฌ๊ธฐ๊ฐ€ ๋ฐฐ์น˜๋˜๋”๋ผ๋„ ํ•ฉ๋ฆฌ์ ์ธ ๋ฌด์–ธ๊ฐ€๋ฅผ ํ‘œ์‹œํ•˜๋„๋ก ๋…ธ๋ ฅํ•  ๊ฒƒ์ด๋‹ค.
 
 
 

3๏ธโƒฃ  Accelerating the share sheet

URL์„ ๊ณต์œ ํ•  ์•ฑ์— ๋Œ€ํ•ด Share Sheet๋Š” ์ž๋™์œผ๋กœ link์˜ ๋ฏธ๋ฆฌ๋ณด๊ธฐ๋ฅผ sheet์˜ header์— ํ‘œ์‹œํ•œ๋‹ค. ๊ทธ๋Ÿฌ๋‚˜ ์ด ๋ฏธ๋ฆฌ๋ณด๊ธฐ๋Š” Share Sheet๊ฐ€ present๋˜์ž๋งˆ์ž ๋ฉ”ํƒ€๋ฐ์ดํ„ฐ๋ฅผ ์–ป๊ธฐ ์œ„ํ•ด ์„œ๋ฒ„์™€ ์—ฐ๊ฒฐํ•ด์•ผํ•˜๊ธฐ ๋•Œ๋ฌธ์— title๊ณผ icon์€ ๋น„๋™๊ธฐ์ ์œผ๋กœ ๋ณด์—ฌ์ง„๋‹ค. ๋”ฐ๋ผ์„œ ๋ฏธ๋ฆฌ๋ณด๊ธฐ๊ฐ€ header์— ๋ฐ”๋กœ ๋ฐ˜์˜๋˜์–ด ๋‚˜ํƒ€๋‚˜์ง€ ์•Š์„ ์ˆ˜๋„ ์žˆ๋‹ค. ๋งŒ์•ฝ URL์— ๋Œ€ํ•œ LPLinkMetadata ๊ฐ์ฒด๋ฅผ Share Sheet์— ์ „๋‹ฌํ•˜๊ธฐ๋งŒ ํ•˜๋ฉด ๋„คํฌ์›Œํฌ ๋กœ๋”ฉ์—†์ด ์ฆ‰๊ฐ์ ์œผ๋กœ ๋ฏธ๋ฆฌ๋ณด๊ธฐ๊ฐ€ ๋‚˜ํƒ€๋‚œ๋‹ค. ์ด๋ฅผ ๊ตฌํ˜„ํ•˜๊ธฐ ์œ„ํ•ด์„œ UIActivityItemSource์˜ ๊ตฌํ˜„์— ์ƒˆ๋กœ์šด activityViewControllerLink Metadata ๋ฉ”์„œ๋“œ๋ฅผ ์‚ฌ์šฉํ•  ์ˆ˜ ์žˆ์œผ๋ฉฐ ๋‹จ์ˆœํžˆ ๋ฉ”ํƒ€๋ฐ์ดํ„ฐ ๊ฐ์ฒด๋ฅผ ๋ฐ˜ํ™˜ํ•˜๋ฉด ๋œ๋‹ค. ๋งŒ์•ฝ ์‚ฌ์šฉ์ž๊ฐ€ ๋ฉ”์„ธ์ง€๋ฅผ ๊ณต์œ ํ•œ๋‹ค๋ฉด, ๊ฐ™์€ ๋ฉ”ํƒ€๋ฐ์ดํ„ฐ๋Š” ๋ถˆํ•„์š”ํ•œ ๋กœ๋”ฉ ์—†์ด ๋ถ€๋“œ๋Ÿฝ๊ณ  ์•„์ฃผ ๋งค๋„๋Ÿฌ์šด ๊ฒฝํ—˜์„ ์ œ๊ณตํ•˜๋ฉฐ ๋ฐ”๋กœ ์ „๋‹ฌ๋  ๊ฒƒ์ด๋‹ค.

// Provider prefetched metadata to UIActivityViewController via UIActivityItemSource

func activityViewControllerLinkMetadata(_: UIActivityViewController) -> LPLinkMetadata? {
    return self.metadata
}

 
๋งŒ์•ฝ title๊ณผ image๊ฐ€ ๋“ค์–ด ์žˆ๋Š” ๋ฐ์ดํ„ฐ๋ฒ ์ด์Šค๋ฅผ ์ด๋ฏธ ๊ฐ€์ง€๊ณ  ์žˆ๋‹ค๋ฉด, Share Sheet๋ฅผ ๋น ๋ฅด๊ฒŒ ๋„์šฐ๊ธฐ ์œ„ํ•ด ๋˜๋Š” rich link๋ฅผ ํ‘œ์‹œํ•˜๊ธฐ ์œ„ํ•ด  ๋ฉ”ํƒ€๋ฐ์ดํ„ฐ๋ฅผ ์ธํ„ฐ๋„ท์—์„œ ๋‹ค์‹œ ๊ฐ€์ ธ์˜ฌ ํ•„์š”๋Š” ์—†๋‹ค. ๋Œ€์‹  LPLinkMetadata์˜ field๋“ค์„ ์šฐ๋ฆฌ๊ฐ€ ๊ฐ€์ง€๊ณ  ์žˆ๋Š” ๋ฐ์ดํ„ฐ๋กœ ์ฑ„์›Œ๋ผ. ๊ทธ๋Ÿฌ๋ฉด LPLinkMetadata ๊ฐ์ฒด๋ฅผ ๋งŒ๋“ค๊ณ  ์ตœ์†Œํ•œ ์›๋ž˜ URL ๋ฐ URL field๋“ค์„ ์šฐ๋ฆฌ๊ฐ€ ๊ฐ€์ง€๊ณ  ์žˆ๋Š” ์ถ”๊ฐ€์ ์ธ ์ •๋ณด๋ฅผ ๋”ํ•ด๋ผ.

// Provide custim metadata to UIActivityViewController via UIActivityItemSource.

func activityViewControllerLinkMetadata(_: UIActivityViewController) -> LPLinkMetadata? {
    let metadata = LPLinkMetadata()
    metadata.originalURL = URL(string: "https://www.example.com/apple-pie")
    metadata.url = metadata.originalURL
    metadata.title = "The Greatest Apple Pie In The World"
    metadata.imageProvider = NSItemProvider.init(contentsOf:
        Bundle.main.url(forResource: "apple-pie", withExtension: "jpg"))
    return metadata
}

 
 
 
 

โœจ ํ•ต์‹ฌ ํ‚ค์›Œ๋“œ 3

 1. ์ž„์˜์˜ URLs์— ๋Œ€ํ•œ ๋” ๋งŽ์€ ๋‚ด์šฉ์„ ์ œ๊ณตํ•˜๊ธฐ ์œ„ํ•ด  LP metadata provider๋ฅผ ์‚ฌ์šฉํ•˜์—ฌ URL์— ๋Œ€ํ•œ ํ’๋ถ€ํ•œ ๋ฉ”ํƒ€๋ฐ์ดํ„ฐ๋ฅผ ๊ฐ€์ ธ์˜ฌ ์ˆ˜ ์žˆ๋‹ค.
2. LP link view๋ฅผ ์‚ฌ์šฉํ•˜์—ฌ ์•„๋ฆ„๋‹ต๊ณ  ์‹œ์Šคํ…œ๊ณผ ์ผ๊ด€์„ฑ์žˆ๋Š” ๋ฐฉ์‹์œผ๋กœ ์•ฑ์— links๋ฅผ ํ‘œ์‹œํ•  ์ˆ˜ ์žˆ๋‹ค(present).
3. prefetchํ•˜๊ฑฐ๋‚˜ ๊ธฐ์กด์˜ LPLinkMetadata๋ฅผ ์‚ฌ์šฉํ•˜์—ฌ ์•ฑ์— Share Sheet ๋ฏธ๋ฆฌ๋ณด๊ธฐ๋ฅผ ๋น ๋ฅด๊ฒŒ ๋„์šธ ์ˆ˜ ์žˆ๋‹ค(accelerate).
 
 
 

๐Ÿงš๐Ÿป‍โ™€๏ธ ๊ธ€์„ ๋งˆ๋ฌด๋ฆฌํ•˜๋ฉฐ

SNS๋ฅผ ๋งŽ์ด ์‚ฌ์šฉํ•˜๋Š” ์‚ฌ๋žŒ๋“ค์€ Link Presentation์„ ์ •๋ง ๋งŽ์ด ๋ณด์•˜์„ ๊ฒƒ์ด๋‹ค. ๋‚˜ ๋˜ํ•œ ์นดํ†ก์œผ๋กœ ์—ฌ๋Ÿฌ ๋ฏธ๋””์–ด๋ฅผ ์ „์†กํ•˜๋ฉด์„œ Link Presentation ํ˜•ํƒœ๋ฅผ ๋งŽ์ด ๋ณด์•„์™”๋‹ค. ํ•˜์ง€๋งŒ ๊ทธ ํ˜•ํƒœ๊ฐ€ ์ด ํ”„๋ ˆ์ž„์›Œํฌ๋ฅผ ์‚ฌ์šฉํ•œ ๊ฒƒ์ด๋ผ๊ณ ๋Š” <์•ผ๊ธฐ>๋ฅผ ๊ตฌํ˜„ํ•  ๋•Œ ์‚ฌ์šฉํ–ˆ์Œ์—๋„ ์•Œ์ง€ ๋ชปํ–ˆ๋‹ค. ์ด๋ ‡๊ฒŒ Link Presentation์„ ์ •๋ฆฌํ•ด๋ณด๋‹ˆ ํ™•์‹คํ•˜๊ฒŒ ์ด ํ”„๋ ˆ์ž„์›Œํฌ์˜ ์šฉ๋„๋ฅผ ์•Œ ์ˆ˜ ์žˆ์—ˆ๋‹ค. ๋˜ iOS๋ฅผ ์‹œ์ž‘ํ•œ์ง€ ๊ฝค ๋˜์—ˆ์Œ์—๋„ WWDC๊ฐ€ ์•„์ง ์–ด๋ ต๊ณ  ๋ฉ€๊ฒŒ๋งŒ ๋Š๊ปด์กŒ๋Š”๋ฐ ์ด๋ฒˆ์— ์ด๋ ‡๊ฒŒ ๊ฒฝํ—˜ํ•˜๊ณ  ๋‚˜๋‹ˆ ๋‹ค์Œ๋ถ€ํ„ฐ๋Š” ๊ณต์‹๋ฌธ์„œ์ฒ˜๋Ÿผ ํŽธํ•˜๊ฒŒ ๋ณด๊ณ  ๋งค๋…„ WWDC๊ฐ€ ์—ด๋ฆด ๋•Œ๋งˆ๋‹ค ๊ด€์‹ฌ์„ ๊ฐ€์ง€๊ณ  ๋ณผ ์ˆ˜ ์žˆ์„ ๊ฒƒ ๊ฐ™๋‹ค.
 

 

๐Ÿ”ฅ ํ•œ ์ค„ ์ •๋ฆฌ

Link Presentation๋Š” URL์„ ์‚ฌ์šฉ์ž ์นœํ™”์ ์ด๊ณ  ์ผ๊ด€๋œ ๋ชจ์Šต์œผ๋กœ ๋ณด์—ฌ์ค„ ์ˆ˜ ์žˆ๋„๋ก ๋„์™€์ฃผ๋Š” ํ”„๋ ˆ์ž„์›Œํฌ์ด๋‹ค. metadata ๊ฐ์ฒด๋Š” selializableํ•˜๋ฏ€๋กœ URL์˜ ๋ฉ”ํƒ€๋ฐ์ดํ„ฐ๋ฅผ ๋งค๋ฒˆ ๋„คํŠธ์›Œํฌ์™€ ์ž‘์—…ํ•˜๊ธฐ ๋ณด๋‹ค๋Š” ๋กœ์ปฌ์— cacheํ•˜์—ฌ ์‚ฌ์šฉํ•˜๋Š” ํŽธ์ด ์ข‹๋‹ค. ๋˜ metadata๋Š” Share Sheet์˜ ๋ฏธ๋ฆฌ๋ณด๊ธฐ๋ฅผ ์ž„์˜๋กœ ๊ตฌ์„ฑํ•  ์ˆ˜ ์žˆ๊ฒŒ ํ•ด์ฃผ๋ฉฐ ๋„คํŠธ์›Œํฌ ๋กœ๋”ฉ ์—†์ด ๋ฏธ๋ฆฌ๋ณด๊ธฐ๋ฅผ ๋น ๋ฅด๊ฒŒ ๋งŒ๋“ค ์ˆ˜ ์žˆ๋‹ค.

728x90