์ฐธ๊ณ
https://dkrnfls.tistory.com/137
์ด์
๋ฅ๋งํฌ ์์
์ค์
๋ค์๊ณผ ๊ฐ์ด intent๋ฅผ ๋ฐ์์๋ค.
intent action: android.intent.action.VIEW / data : something://action?authorize=0id4gzmDNXhJY9xbNsOYpbg/rLuhKEc2zyWwZ+7s6YF9Pju8hVErS8Pshsi+ugWPrPW1pieHA2mrzSMKOifAWgaQV4w=
๋ค์๊ณผ ๊ฐ์ด ์ฟผ๋ฆฌ ํ๋ผ๋ฏธํฐ ๊ฐ์ ๊ตฌํ๋๋ฐ, '+' ๊ฐ์ด ' '์ด๋ฐ ๊ณต๋ฐฑ์ผ๋ก ์ฑ์์ ธ์ ๊ฐ์ ๋ฐ์๋ค.
val uri = intent.data
val authorizeCode = uri.getQueryParameter("authorize")
๋ด๊ฐ ์ํ๋ ๊ฒฐ๊ณผ authorizedCode ๊ฐ
0id4gzmDNXhJY9xbNsOYpbg/rLuhKEc2zyWwZ+7s6YF9Pju8hVErS8Pshsi+ugWPrPW1pieHA2mrzSMKOifAWgaQV4w=
์ค์ ๊ฐ
0id4gzmDNXhJY9xbNsOYpbg/rLuhKEc2zyWwZ 7s6YF9Pju8hVErS8Pshsi ugWPrPW1pieHA2mrzSMKOifAWgaQV4w=
ํด๊ฒฐ
Uri.getQueryParameter() ๋์ Uri.getQueryParameters()๋ฅผ ์ฌ์ฉํ๋ค.
https://dkrnfls.tistory.com/137
https://developer.android.com/reference/android/net/Uri#getQueryParameters(java.lang.String)
val uri = intent.data
val authorizeCode : List<String> = uri.getQueryParameters("authorize")
'๊ณณ๊ฐ์์ ์ธ์ฌ๋๋ค > ์ค๋ฌด' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
[๊ตฌ๊ธ ํ๋ ์ด ์ฝ์][๊ฒฝํ] ์ฑ ๊ฒ์ ์ค์ ON ๋ณ๊ฒฝ ์์๋ ๊ฒ์๋ฅผ ํ๋ค (0) | 2024.04.04 |
---|---|
[Android][WebView] HTML TAG ํ์ฑ - Jsoup (0) | 2024.04.04 |
[ํ์ ][๊ฒฝํ ๋์๋ณด๊ธฐ] Jira ํ์ (0) | 2024.04.04 |
[์ค๋ฌด] ๊ณ ๋ ค์ฌํญ / ๋ฐ์ ํผ๋๋ฐฑ (0) | 2024.03.20 |
[Android] Uri๋ก๋ถํฐ ํ์ฅ์ ์ป๊ธฐ (0) | 2023.10.28 |