title: What API restriction do I have to whitelist in order to use Firebase Cloud Messaging?
body: <p>I am currently using Firebase in iOS app with flutter framework.</p>
  
  <p>The default Google Cloud API key created by firebase has unrestricted access to APIs, so I want to restrict it to certain APIs that my app uses for security reasons.</p>
  
  <p>However, after making API restrictions, almost all firebase related components work fine, but the app does not seem to be able to get Firebase Cloud Messaging Token (e.g. FirebaseMessaging.getToken() call fails). The app suppose to retrieve this token and send it to the backend server such that the server can send FCM messages, but when this call is made, it just hangs for a while and returns null. </p>
  
  <p>When my app key has unrestricted access to APIs, it retrieves FCM token fine, but as soon as I restrict it, it fails to retrieve the token.</p>
  
  <p>I currently have whitelisted following APIs for the Firebase iOS App Key.</p>
  
  <ul>
  <li>Identity Toolkit API</li>
  <li>Token Service API</li>
  <li>Firebase Remote Config API</li>
  <li>Firebase Dynamic Links API</li>
  <li>FCM Registration API</li>
  <li>Firebase Cloud Messaging API</li>
  </ul>
  
  <p>I have gone through other API list and they do not seem to be related to Firebase Cloud Messaging at all, so I did not select anything else, so I am stuck. Has anyone else encountered this problem when they tried to restrict Firebase API key?</p>
  
  <p>(I am attaching the full API permission list below.)</p>
  
  <pre><code>App Engine Admin API
  BigQuery API
  BigQuery Storage API
  Cloud Build API
  Cloud Datastore API
  Cloud Debugger API
  Cloud Deployment Manager V2 API
  Cloud DNS API
  Cloud Firestore API
  Cloud Functions API
  Cloud Logging API
  Cloud Messaging
  Cloud Monitoring API
  Cloud OS Login API
  Cloud Pub/Sub API
  Cloud Resource Manager API
  Cloud Run API
  Cloud Runtime Configuration API
  Cloud Scheduler API
  Cloud Source Repositories API
  Cloud SQL
  Cloud SQL Admin API
  Cloud Storage
  Cloud Tasks API
  Cloud Testing API
  Cloud Trace API
  Compute Engine API
  Container Registry API
  FCM Registration API
  Firebase App Distribution API
  Firebase Cloud Messaging API
  Firebase Dynamic Links API
  Firebase Extensions API
  Firebase Hosting API
  Firebase Installations API
  Firebase Management API
  Firebase Mods API
  Firebase Remote Config API
  Firebase Rules API
  Google Cloud APIs
  Google Cloud Storage JSON API
  Google Play Android Developer API
  IAM Service Account Credentials API
  Identity and Access Management (IAM) API
  Identity Toolkit API
  Kubernetes Engine API
  Legacy Cloud Source Repositories API
  Maps Embed API
  Maps JavaScript API
  Maps SDK for Android
  Maps SDK for iOS
  Maps Static API
  Mobile Crash Reporting API
  Service Management API
  Service Usage API
  Stackdriver API
  Street View Publish API
  Street View Static API
  Token Service API
  </code></pre>