# 메시지 전송 후 푸시가 안됩니다 (Push Notification didn't show up after sent message to others)

**URL:** <https://community.sendbird.com/t/push-notification-didnt-show-up-after-sent-message-to-others/9299>\
**Category:** Flutter\
**Tags:** push-notification, chatsdk\
**Created:** [April 1, 2024, 8:41am UTC](https://community.sendbird.com/t/push-notification-didnt-show-up-after-sent-message-to-others/9299 "2024-04-01T08:41:01Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![calring](https://avatars.discourse-cdn.com/v4/letter/c/d26b3c/32.png) [@calring](https://community.sendbird.com/u/calring)\
**Post date:** [April 1, 2024, 8:41am UTC](https://community.sendbird.com/t/push-notification-didnt-show-up-after-sent-message-to-others/9299/1 "2024-04-01T08:41:01Z")

</div>

**[Problem/Question]**  
메시지 전송 후 받는 사람에게 푸시가 안뜹니다.

안녕하세요,

```auto
sendMessage(String messageBody) async {
    final params = UserMessageCreateParams(message: messageBody)
      ..customType = channelType
      ..pushNotificationDeliveryOption = PushNotificationDeliveryOption.normal
      ..data = jsonEncode({
        "alarmType": "chat",
        "channelUrl": channelUrl,
        "senderImage": myProfileUrl,
      });
    thisChannel!.sendUserMessage(params);
  }

```

위 코드로 메시지를 보냈는데 보내고 받는 건 다 되는데  
받는 쪽에서 푸시가 안오네요  
현재 안드로이드 에뮬레이터를 사용해서 테스트 하고 있습니다.

두대의 에뮬레이터에서 사용중이고  
두대 모두 Sendbird 서버에는 푸시투큰이 정상적으로 등록되어 있습니다.

Dashboard에서도 offline/online 모두 받을 수 있게 했고,  
테스트 메시지를 보냈을 때에도 메시지가 정상적으로 전송되었다는 팝업은 뜨는데  
정작 에뮬레이터에서는 푸시가 뜨지 않습니다.

혹시 푸시를 받기 위해서는 따로 해야하는 작업이 있을까요?

---

<div class="post-metadata">

**Author:** ![Yongjun\_Choi](https://sea2.discourse-cdn.com/flex020/user_avatar/community.sendbird.com/yongjun_choi/32/36_2.png) [@Yongjun\_Choi](https://community.sendbird.com/u/Yongjun_Choi)\
**Post date:** [April 2, 2024, 9:00am UTC](https://community.sendbird.com/t/push-notification-didnt-show-up-after-sent-message-to-others/9299/2 "2024-04-02T09:00:48Z")

</div>

안녕하세요.  
푸시를 등록할 때 alwaysPush 옵션이 true 로 등록 후 테스트를 해보시길 제안 드립니다.  
해당 옵션이 true 인 상태로 토큰이 등록 될 때 온라인 상태에서도 푸시를 수신할 수 있는 조건이 됩니다.  
감사합니다.

> **[registerPushToken method - SendbirdChat class - sendbird\_chat\_sdk library -...](https://pub.dev/documentation/sendbird_chat_sdk/latest/sendbird_chat_sdk/SendbirdChat/registerPushToken.html)**
>
> API docs for the registerPushToken method from the SendbirdChat class, for the Dart programming language.

```auto
static Future<PushTokenRegistrationStatus> registerPushToken({
  required PushTokenType type,
  required String token,
  bool alwaysPush = false,
  bool unique = false,
}) async {
  sbLog.i(StackTrace.current, 'PushTokenType: $type');
  return await _instance._chat.registerPushToken(
    type: type,
    token: token,
    alwaysPush: alwaysPush,
    unique: unique,
  );
}

```

---

<div class="post-metadata">

**Author:** ![calring](https://avatars.discourse-cdn.com/v4/letter/c/d26b3c/32.png) [@calring](https://community.sendbird.com/u/calring)\
**Post date:** [April 3, 2024, 6:24am UTC](https://community.sendbird.com/t/push-notification-didnt-show-up-after-sent-message-to-others/9299/3 "2024-04-03T06:24:10Z")

</div>

답변 감사합니다.

말씀하신대로 alwaysPush 옵션을 true로 놓고 등록을 했는데요,

메시지는 받았다고 확인을 했는데 push 팝업이 안뜨네요  
혹시 push 팝업을 받기위해서는 어떻게 해야 할까요?

```auto
  sendMessage(String messageBody) async {
    final params = UserMessageCreateParams(message: messageBody)
      ..customType = channelType
      ..pushNotificationDeliveryOption = PushNotificationDeliveryOption.normal
      ..data = jsonEncode({
        "alarmType": "chat",
        "channelUrl": channelUrl,
        "senderImage": myProfileUrl,
      });
    thisChannel!.sendUserMessage(params);
  }

```

메시지 전송은 위와같은 코드로 했습니다.  
답변 기다리겠습니다  
감사합니다.

---

<div class="post-metadata">

**Author:** ![Yongjun\_Choi](https://sea2.discourse-cdn.com/flex020/user_avatar/community.sendbird.com/yongjun_choi/32/36_2.png) [@Yongjun\_Choi](https://community.sendbird.com/u/Yongjun_Choi)\
**Post date:** [April 3, 2024, 10:16am UTC](https://community.sendbird.com/t/push-notification-didnt-show-up-after-sent-message-to-others/9299/4 "2024-04-03T10:16:38Z")

</div>

안녕하세요.  
푸시 팝업이 뜨지 않는 다는 말씀이 명확하지 않지만, FCM에서 전달되는 payload 에 notifications 데이터가 없어서 팝업이 뜨지 않는 현상을 말씀 하시는 것이라면,

기본적으로 payload 에 센드버드 서버에서는 notifications 영역은 담아서 보내고 있지 않습니다.  
payload의 data 영역 에서 받아서 컨트롤 하는 것을 기대하고 있습니다.

> **[Set up push notifications for FCM | Chat Android SDK | Sendbird Docs](https://sendbird.com/docs/chat/sdk/v4/android/push-notifications/managing-push-notifications/set-up-push-notifications-for-fcm#2-step-5-handle-an-fcm-message-payload)**
>
> Guides for quick and easy integration of Sendbird Chat, Calls and Desk for iOS, Android, JavaScript, Unity, .NET and Platform API.

다만 notifications 영역도 함께 전달받고자 하시면 센드버드 기술지원팀에 사용하고 계신 앱아이디와 함께 use\_fcm\_notification 설정을 해 달라고 요청을 하시면 됩니다.

감사합니다.

---

<div class="post-metadata">

**Author:** ![calring](https://avatars.discourse-cdn.com/v4/letter/c/d26b3c/32.png) [@calring](https://community.sendbird.com/u/calring)\
**Post date:** [April 3, 2024, 10:44am UTC](https://community.sendbird.com/t/push-notification-didnt-show-up-after-sent-message-to-others/9299/5 "2024-04-03T10:44:23Z")

</div>

답변 감사합니다.

말씀해주신 문제인듯해서  
기술지원팀에 use\_fcm\_notification 설정을 요청했습니다.

감사합니다.
