title: <FIRMessaging/WARNING> FIRMessaging registration is not ready with auth credentials
body: <p>I want to integrate Firebase Cloud Messaging with my application, but when I run the  application, I am getting following errors:</p>
  
  <ol>
  <li><p><code>&lt;FIRMessaging/WARNING&gt; FIRMessaging registration is not ready with auth credentials.</code></p></li>
  <li><p><code>Unable to connect to FCM. Error Domain=com.google.fcm Code=501 "(null)"</code></p></li>
  </ol>
  
  <p>Here is my code:</p>
  
  <pre><code>- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
  
      if (floor(NSFoundationVersionNumber) &lt;= NSFoundationVersionNumber_iOS_7_1) {
          // iOS 7.1 or earlier
          UIRemoteNotificationType allNotificationTypes =
          (UIRemoteNotificationTypeSound | UIRemoteNotificationTypeAlert | UIRemoteNotificationTypeBadge);
          [application registerForRemoteNotificationTypes:allNotificationTypes];
      } else {
          // iOS 8 or later
          // [END_EXCLUDE]
          UIUserNotificationType allNotificationTypes =
          (UIUserNotificationTypeSound | UIUserNotificationTypeAlert | UIUserNotificationTypeBadge);
          UIUserNotificationSettings *settings =
          [UIUserNotificationSettings settingsForTypes:allNotificationTypes categories:nil];
          [[UIApplication sharedApplication] registerUserNotificationSettings:settings];
          [[UIApplication sharedApplication] registerForRemoteNotifications];
      }
  
      [FIRApp configure];
  
      [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(tokenRefreshNotification:)                                             name:kFIRInstanceIDTokenRefreshNotification object:nil];
  
      return YES;
  }
  </code></pre>