메시지는 여러 종류의 수신 데이터를 나타낼 수 있습니다. 가장 일반적인 경우는
개발자가 생성한 메시지를 앱에 보내는 경우입니다. 또한 메시지
전송 이벤트, 메시지 전송 오류 이벤트, 메시지 삭제 이벤트를 나타내기 위해
앱에 메시지를 보내기도 합니다. MessageType 필드를 확인하여 이러한 특수 이벤트를 구분할 수 있습니다.
메시지 삭제
FCM 서버가 대기중인 메시지를 삭제할 때 앱에 전송됩니다.
MessageType은 "deleted_messages"입니다. 다음과 같은 경우 메시지가 삭제될 수 있습니다.
FCM 서버에 저장된 메시지가 너무 많습니다.
기기가 오프라인 상태일 때 앱 서버에서 FCM 서버에 비축소형 메시지를
많이 보내면 이러한 상황이 발생할 수 있습니다.
최근 4주 이내에 앱 서버에서 오랫동안 연결되지 않은
기기의 앱에 메시지를 보냈습니다.
이 호출이 수신되면 앱에서 앱 서버와 전체 동기화를
수행하는 것이 좋습니다.
전송 이벤트
업스트림 메시지가 FCM에 성공적으로 전송되었을 때 호출됩니다.
MessageType은 "send_event"입니다.
전송 오류
업스트림 메시지를 보내는 중에 오류가 발생했을 때 호출됩니다.
MessageType은 "send_error"입니다.
[[["이해하기 쉬움","easyToUnderstand","thumb-up"],["문제가 해결됨","solvedMyProblem","thumb-up"],["기타","otherUp","thumb-up"]],[["필요한 정보가 없음","missingTheInformationINeed","thumb-down"],["너무 복잡함/단계 수가 너무 많음","tooComplicatedTooManySteps","thumb-down"],["오래됨","outOfDate","thumb-down"],["번역 문제","translationIssue","thumb-down"],["샘플/코드 문제","samplesCodeIssue","thumb-down"],["기타","otherDown","thumb-down"]],["최종 업데이트: 2025-09-05(UTC)"],[],[],null,["Receive and handle messages\n\nTo receive messages, your app must assign a callback to the\n[Firebase.Messaging.FirebaseMessaging.MessageReceived](/docs/reference/unity/class/firebase/messaging/firebase-messaging#messagereceived)\nevent handler.\n\n`MessageReceived` Event\n\nBy overriding assigning a callback to\n[Firebase.Messaging.FirebaseMessaging.MessageReceived](/docs/reference/unity/class/firebase/messaging/firebase-messaging#messagereceived)\nyou can perform actions based on the received message and get the message data: \n\n```c#\npublic void OnMessageReceived(object sender, Firebase.Messaging.MessageReceivedEventArgs e) {\n UnityEngine.Debug.Log(\"From: \" + e.Message.From);\n UnityEngine.Debug.Log(\"Message ID: \" + e.Message.MessageId);\n}\n```\n\nMessages can represent different kinds of incoming data. Most commonly,\nmessages are sent to the app after being initiated by the developer. Messages\nare also sent to you app to represent message sent events, message send error\nevents, and messages deleted events. These special events can be differentiated\nby checking the `MessageType` field.\n\nMessages Deleted\n\nSent to your app when the FCM server deletes pending messages.\n`MessageType` will be `\"deleted_messages\"`. Messages may be deleted if:\n\n1. Too many messages are stored on the FCM server.\n\n This can occur when an app's servers send a bunch of non-collapsible\n messages to FCM servers while the device is offline.\n2. The device hasn't connected in a long time and the app server has\n recently (within the last 4 weeks) sent a message to the app on that\n device.\n\n It is recommended that the app do a full sync with the app\n server after receiving this call.\n\nSend Event\n\nCalled when an upstream message has been successfully sent to FCM.\n`MessageType` will be `\"send_event\"`.\n\nSend Error\n\nCalled when there was an error sending an upstream message.\n`MessageType` will be `\"send_error\"`."]]