khs50851
Reviews Written
-
Average Rating
-
Posts
Q&A
Notification ๊ตฌํ์ ์ปดํ์ผ์๋ฌ
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) { if (ContextCompat.checkSelfPermission( this, Manifest.permission.POST_NOTIFICATIONS ) == PackageManager.PERMISSION_GRANTED ) { var builder = NotificationCompat.Builder(this, "TestChannel") .setSmallIcon(R.drawable.ic_launcher_background) .setContentTitle("๋งค์นญ์๋ฃ") .setContentText("๋งค์นญ์ด ์ฑ์ฌ๋์์ต๋๋ค. ๋ฉ์ธ์ง๋ฅผ ํ์ธํ์ธ์!") .setPriority(NotificationCompat.PRIORITY_DEFAULT) .setCategory(NotificationCompat.CATEGORY_MESSAGE) with(NotificationManagerCompat.from(this)) { notify(123, builder.build()) } } else { // ๊ถํ ์์ฒญ requestPermissions(arrayOf(Manifest.permission.POST_NOTIFICATIONS), REQUEST_CODE) } }์์ ๊ฐ์ด ์ฝ๋๋ฅผ ์์ฑํ๋ผ๋ ๋ง์์ด์ ๊ฐ์? ์ด๋ ๊ฒํ๋ฉด ์ปดํ์ผ ์๋ฌ๋ ์ฌ๋ผ์ง๋๋ฐ ์๋ก ์ข์์์ ์๋ฆผ์ด ์ค์ง ์๋ค์..AndroidManifest.xmlํ์ผ์์ ์ฝ๋๊ฐ ์ถ๊ฐ๋์ด์์ต๋๋ค.์กฐ๊ธ ๋ ๊ฒ์ํด๋ดค๋๋ฐ ์๋ with~ ์ฝ๋๋ฅผ ์ง์ฐ๊ณ with(NotificationManagerCompat.from(this)){ notify(123,builder.build()) }val notificationManager = getSystemService(Context.NOTIFICATION_SERVICE) as NotificationManager notificationManager.notify(REQUEST_CODE, builder.build())์ด๋ ๊ฒ ์ฝ๋๋ฅผ ๋ฃ์ผ๋ ์ปดํ์ผ ์๋ฌ ์์ด ์คํ ๋๋ค์ REQUEST_CODE์ ๋์ถฉ ์ ์ 123์ ๋ฃ์์ต๋๋ค.
- 0
- 2
- 337
Q&A
ํ๋ก์ ํธ ๊ตฌ์กฐ๊ฐ ๋ค๋ฆ ๋๋ค
์! ์ฃ์กํฉ๋๋ค. ๊ทธ ๋ถ๋ถ์ ์ ๋๋ก ์๋ดค์๋ค์. ํด๊ฒฐ๋์ต๋๋ค. ๋น ๋ฅธ๋ต๋ณ ๊ฐ์ฌํฉ๋๋ค!
- 0
- 2
- 405
Q&A
ํ์ฉ์ฑ 84๊ฐ
์ดํด๋์ต๋๋ค! ๊ฐ์ฌํฉ๋๋ค!
- 1
- 2
- 463
Q&A
๋คํธ์ํฌ ํต์ ์ ์์(๋ฌธ๋ฒ 172๊ฐ) ์ง๋ฌธ ์์ต๋๋ค.
์ดํด ๋์ต๋๋ค! ๊ฐ์ฌํฉ๋๋ค ใ ใ
- 1
- 2
- 404




