# Push notifications not working in IOS(flutter)

**URL:** https://community.sendbird.com/t/push-notifications-not-working-in-ios-flutter/3771
**Category:** Flutter
**Tags:** push-notification
**Created:** [January 12, 2022, 9:38am UTC](https://community.sendbird.com/t/push-notifications-not-working-in-ios-flutter/3771 "2022-01-12T09:38:18Z")
**Posts on this page:** 9
**Page:** 1

<div class="post-metadata">

### Author: ![arica](https://avatars.discourse-cdn.com/v4/letter/a/ccd318/32.png) [@arica](https://community.sendbird.com/u/arica)
#### Post date: [January 12, 2022, 9:38am UTC](https://community.sendbird.com/t/push-notifications-not-working-in-ios-flutter/3771/1 "2022-01-12T09:38:18Z")

</div>

When I test the push through the APNs push notification tester, “Couldn’t send push notification.Status: 400 (BadDeviceToken)” occurs.

I also checked the Push token in User information, and I also checked the tokens on the device. What is problem?

- Translated into a translator \*

---

<div class="post-metadata">

### Author: ![Tyler](https://sea2.discourse-cdn.com/flex020/user_avatar/community.sendbird.com/tyler/32/810_2.png) [@Tyler](https://community.sendbird.com/u/Tyler)
#### Post date: [January 13, 2022, 4:50pm UTC](https://community.sendbird.com/t/push-notifications-not-working-in-ios-flutter/3771/2 "2022-01-13T16:50:02Z")

</div>

Hi @arica,

Welcome to the Sendbird Community. Can you show me how you’re registering tokens on the Flutter SDK? With Flutter, it sounds like you might be registering an FCM token for APNS or vice versa.

---

<div class="post-metadata">

### Author: ![arica](https://avatars.discourse-cdn.com/v4/letter/a/ccd318/32.png) [@arica](https://community.sendbird.com/u/arica)
#### Post date: [January 17, 2022, 12:48am UTC](https://community.sendbird.com/t/push-notifications-not-working-in-ios-flutter/3771/4 "2022-01-17T00:48:45Z")

</div>

Thank you for your welcome, @Tyler

```auto
  firebaseMessaging.getToken().then((token){
              if (token != null) sendbird.registerPushToken(type: Platform.isIOS ? PushTokenType.apns : PushTokenType.fcm,token: token);
            });

```

I’m registering token with the code above.

---

<div class="post-metadata">

### Author: ![Tyler](https://sea2.discourse-cdn.com/flex020/user_avatar/community.sendbird.com/tyler/32/810_2.png) [@Tyler](https://community.sendbird.com/u/Tyler)
#### Post date: [January 18, 2022, 1:51am UTC](https://community.sendbird.com/t/push-notifications-not-working-in-ios-flutter/3771/5 "2022-01-18T01:51:11Z")

</div>

For iOS, you would need to obtain an APNS token, not a FCM token. Sendbird only sends tokens to iOS devices via APNS.

---

<div class="post-metadata">

### Author: ![Woo](https://sea2.discourse-cdn.com/flex020/user_avatar/community.sendbird.com/woo/32/125_2.png) [@Woo](https://community.sendbird.com/u/Woo)
#### Post date: [January 19, 2022, 2:50am UTC](https://community.sendbird.com/t/push-notifications-not-working-in-ios-flutter/3771/6 "2022-01-19T02:50:55Z")

</div>

I believe firebase has a method to retrieve apns token, you may want to use it for iOS instead getToken

---

<div class="post-metadata">

### Author: ![arica](https://avatars.discourse-cdn.com/v4/letter/a/ccd318/32.png) [@arica](https://community.sendbird.com/u/arica)
#### Post date: [January 19, 2022, 6:11am UTC](https://community.sendbird.com/t/push-notifications-not-working-in-ios-flutter/3771/7 "2022-01-19T06:11:13Z")

</div>

Using getAPNSToken, I’m getting a push from the APNs push notification tester and the real app. Thank you. @Woo@Tyler

But I can’t get an app push on the foreground. What should I do about this? I am sorry that I know very little as a beginner.

“Send to devices both offline and online” have been activated.  
“userNotificationCenter” was also overrided at AppDelegate, but it was not delivered.

---

<div class="post-metadata">

### Author: ![Woo](https://sea2.discourse-cdn.com/flex020/user_avatar/community.sendbird.com/woo/32/125_2.png) [@Woo](https://community.sendbird.com/u/Woo)
#### Post date: [January 19, 2022, 7:13am UTC](https://community.sendbird.com/t/push-notifications-not-working-in-ios-flutter/3771/8 "2022-01-19T07:13:21Z")

</div>

For foreground push, our server does not support for flutter yet and we are about to add this soon! Thanks for your patient.

---

<div class="post-metadata">

### Author: ![arica](https://avatars.discourse-cdn.com/v4/letter/a/ccd318/32.png) [@arica](https://community.sendbird.com/u/arica)
#### Post date: [January 19, 2022, 8:42am UTC](https://community.sendbird.com/t/push-notifications-not-working-in-ios-flutter/3771/9 "2022-01-19T08:42:07Z")

</div>

OK, thank you! X-D

+) I solved it by making a local push in OnMessageReceived!

---

<div class="post-metadata">

### Author: ![Tyler](https://sea2.discourse-cdn.com/flex020/user_avatar/community.sendbird.com/tyler/32/810_2.png) [@Tyler](https://community.sendbird.com/u/Tyler)
#### Post date: [January 19, 2022, 4:13pm UTC](https://community.sendbird.com/t/push-notifications-not-working-in-ios-flutter/3771/10 "2022-01-19T16:13:43Z")

</div>


