인프런 커뮤니티 질문&답변
Retrofit 사용해보기 강의 2:20 쯤에 작성된 복사된 코드는 어디서 받나요?
작성
·
232
퀴즈
71%나 틀려요. 한번 도전해보세요!
앱에서 Firebase 푸시 알림 메시지를 직접 수신하고 처리하기 위해 주로 구현해야 하는 안드로이드 서비스는 무엇일까요?
Retrofit Service
Firebase Messaging Service
Notification Manager
Background Service
답변 2
0
0
개복치개발자
지식공유자
안녕하세요
섹션0 강의소개에
전체소스코드에서 다운받아서 사용하시면 됩니다 아래 코드입니다.
import com.bokchi.sogating_final.message.fcm.Repo.Companion.CONTENT_TYPE
import com.bokchi.sogating_final.message.fcm.Repo.Companion.SERVER_KEY
import okhttp3.ResponseBody
import retrofit2.Response
import retrofit2.http.Body
import retrofit2.http.Headers
import retrofit2.http.POST
interface NotiAPI {
@Headers("Authorization: key=$SERVER_KEY", "Content-Type:$CONTENT_TYPE")
@POST("fcm/send")
suspend fun postNotification(@Body notification: PushNotification): Response<ResponseBody>
}





