Question: I'm developing an app that uses Firebase push notifications. It worked well until I tried in iOS 11. Using an iphone with ios 11 the notifications don't arrive. Here's my code:

```
- (void)application:(UIApplication *)application 
  didReceiveRemoteNotification:(NSDictionary *)userInfo
  fetchCompletionHandler:(void (^)
  (UIBackgroundFetchResult))completionHandler {
      //Manage notification
  }

- (void)userNotificationCenter:(UNUserNotificationCenter *)center
   willPresentNotification:(UNNotification *)notification
     withCompletionHandler:(void (^)(UNNotificationPresentationOptions))completionHandler{
    //Manage notification
}

```

Neither of the methods are called.

Thanks for the help!

Answer: 
I got stuck like 3 hours and then 2 steps found on net helped me. 

1. Try call firebase notification send externally like this - just replace ServerKey for your account serverkey and FCM\_TOKEN for your app fcm token:

> 
> 
> ```
> curl -X "POST" "https://fcm.googleapis.com/fcm/send" \
>      -H "Authorization: key=ServerKey" \
>      -H "Content-Type: application/json" \
>      -d $'{
>   "notification": {
>     "body": "Testing with direct FCM API",
>     "title": "Test Message",
>     "badge": "0",
>     "sound": "default"
>   },
>   "registration_ids": [
> "FCM_TOKEN"
>   ]
> }'
> 
> ```
> 
> 

2. You will get some error response probably. I've got "InvalidApnsCredential" which was due to not matching TeamID in firebase and apple developer account (more specifically auth token key) -> also be careful that firebase really changes TeamID event after save (it gave me many invalid save changes which occured after browser refresh)
Can you try this

```
    Messaging.messaging().delegate = self
    Messaging.messaging().shouldEstablishDirectChannel = true

```