Notice
Recent Posts
Recent Comments
Link
ยซ   2024/05   ยป
์ผ ์›” ํ™” ์ˆ˜ ๋ชฉ ๊ธˆ ํ† 
1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31
Archives
Today
Total
๊ด€๋ฆฌ ๋ฉ”๋‰ด

lgvv98

[Swift] kakaoMap API URL Scheme ๊ฐ„๋‹จ ์‚ฌ์šฉ๋ฒ•.๐Ÿ“ ๋ณธ๋ฌธ

โš ๏ธ deprecated โš ๏ธ/REST API ์—ฐ์Šต์žฅ

[Swift] kakaoMap API URL Scheme ๊ฐ„๋‹จ ์‚ฌ์šฉ๋ฒ•.๐Ÿ“

๐Ÿฅ• ์บ๋Ÿฟ๋งจ 2022. 1. 17. 00:50

โœ… ์ด๋ฒˆ ์‹œ๊ฐ„์—๋Š” kakaoMap ์‚ฌ์šฉ๋ฒ•์— ๋Œ€ํ•ด์„œ ๊ฐ„๋žตํžˆ ์•Œ์•„๋ณด๊ณ  ๋„˜์–ด๊ฐˆ ์˜ˆ์ •์ด์•ผ. 

 

์นด์นด์˜ค ๋งต API์˜ ๊ฒฝ์šฐ์—๋Š” ์•„๋ž˜ ์‚ฌ์ดํŠธ์— ๊ฐ€๋ฉด ๋” ์ž์„ธํžˆ ๋ณผ ์ˆ˜ ์žˆ์–ด.

https://apis.map.kakao.com/ios/

 

์ดํ›„๋กœ๋Š” ๊ฐ€์ด๋“œ๋ฅผ ๋ณด๋ฉด์„œ ๋”ฐ๋ผ๊ฐ€๋ฉด ๋˜๋Š”๋ฐ,

https://apis.map.kakao.com/ios/guide/

๊ฐ€์ด๋“œ๋ฅผ ์šฐ์„  ๋”ฐ๋ผ๊ฐ€์ค˜.

 

โœ… URL Scheme๋ฅผ ์‚ฌ์šฉํ•˜๋Š” ๋ฐฉ๋ฒ•

์ด๊ฑฐ๋ฅผ ์šฐ์„  ์ถ”๊ฐ€ํ•ด์ค˜.

 

โœ… ViewController.swift

class ViewController: UIViewController {
	 @IBAction func mapSchemeBtn(_ sender: Any) {
        let urlString = "kakaomap://open"
        if let appUrl = URL(string: urlString) {
            if(UIApplication.shared.canOpenURL(appUrl)) {
                UIApplication.shared.open(appUrl, options: [:], completionHandler: nil)
            } else {
                let showAlert = UIAlertController(title: "์•ˆ๋‚ด", message: "์•ฑ์ด ์„ค์น˜ ์•ˆ๋˜์—ˆ๊ฑฐ๋‚˜ ์˜ค๋ฅ˜์ž„", preferredStyle: .alert)
            }
        }
    }
}

์œ„์™€ ๊ฐ™์ด ์ฝ”๋“œ๋ฅผ ๋„ฃ์–ด์ฃผ๋ฉด ๋ผ.

 

๊ทธ๋ฆฌ๊ณ  ์•ฑ์„ ์‹คํ–‰ํ•˜๋ฉด ๋„์..!

Comments