Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

<FIRMessaging/WARNING> FIRMessaging registration is not ready with auth credentials

I want to integrate Firebase Cloud Messaging with my application, but when I run the application, I am getting following errors:

  1. <FIRMessaging/WARNING> FIRMessaging registration is not ready with auth credentials.

  2. Unable to connect to FCM. Error Domain=com.google.fcm Code=501 "(null)"

Here is my code:

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {

    if (floor(NSFoundationVersionNumber) <= 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;
}
like image 361
Subhajit Mondal Avatar asked Dec 19 '25 09:12

Subhajit Mondal


1 Answers

A possible answer is that you haven't added your Apple APS Certificates for Dev and Production. These are required to send push notifications on iOS. You do have to have a Paid Apple Developer's license to generate these certificates. To generate these, open this link, and then go to certificates, and click the plus button in the top right hand corner to create a new certificate. Then follow the instructions on the following pages until you have downloaded the signed certificate from Apple. Then go to the firebase console and then to your project. Then click on the gear, and then on project settings. Open cloud messaging, and then at the bottom, upload your dev and production certificates and enter the passwords you used when creating them. Hope this helps, if you have any trouble, feel free to ask.

like image 52
gm_ Avatar answered Dec 21 '25 23:12

gm_



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!