# Flutter InAppWebview PushNotification (FCM) 오류

**URL:** <https://community.sendbird.com/t/flutter-inappwebview-pushnotification-fcm/7800>\
**Category:** JavaScript\
**Tags:** push-notification, chatsdk\
**Created:** [July 10, 2023, 5:44am UTC](https://community.sendbird.com/t/flutter-inappwebview-pushnotification-fcm/7800 "2023-07-10T05:44:23Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![operator\_dkargo](https://sea2.discourse-cdn.com/flex020/user_avatar/community.sendbird.com/operator_dkargo/32/4263_2.png) [@operator\_dkargo](https://community.sendbird.com/u/operator_dkargo)\
**Post date:** [July 10, 2023, 5:44am UTC](https://community.sendbird.com/t/flutter-inappwebview-pushnotification-fcm/7800/1 "2023-07-10T05:44:23Z")

</div>

**[Problem/Question]**  
// Detailed description of issue.

Nexjs로 구성된 웹을 Flutter로 감싸서 사용중입니다.

javascript Chat SDK를 사용하여 Next.js 에서 채팅을 구현중인데,

Push Notification을 연동할 방법은 webhook 밖에 없는건가요?

앱에서 사용중인 fcmToken을

```
// AOS
await sendbirdChat.registerFCMPushTokenForCurrentUser(fcm_token);

// IOS
await sendbirdChat.registerAPNSPushTokenForCurrentUser(fcm_token);

```

함수를 통해 등록하고 해당 유저의 token이 업데이트되는것 까지는 확인했는데,

Setting에서 Push Notification 테스틑 해보니

AOS는 PUSH가 오지 않지만 ( 기존 FCM 과 구성형태가 다르게 오는걸로는 확인까진 되었음 )

IOS는 400 Bad Couldn’t send push notification.  
Status: 400 (BadDeviceToken)

IOS Edit APNs SSL credential에서 .p8로 설정하고

Bundle ID, Key ID, Team ID 모두 정상적으로 입력하였고  
uplodad credential 에서 p8 파일을 업로드했습니다 ( 수정 시 해당 파일은 등록할때 처럼 등록되어있다곤 나오진 않음 )

또한 xcode 에서 release로 빌드하고 해당 fcmToken 으로 푸쉬가 정상적으로 이뤄지는것 까지 확인했는데,  
해당 토큰으로 보내려고하면 이런 에러가 발생합니다.

### Couldn’t send push notification.

Mismatched device token. Please enter correct device token for the provider.

에러가 발생합니다.

어떤 부분을 확인해야할까요?

* * *

// If problem, please fill out the below. If question, please delete.  
**[SDK Version]**  
// What version of the SDK are you using?

**[Reproduction Steps]**  
// Please provide reproduction steps and, if possible, code snippets.

**[Frequency]**  
// How frequently is this issue occurring?

**[Current impact]**  
// How is this currently impacting your implementation?
