小编Sub*_*dal的帖子

<FIRMessaging/WARNING> FIRMessaging注册尚未准备好使用身份验证凭据

我想将Firebase Cloud Messaging与我的应用程序集成,但是当我运行应用程序时,我遇到以下错误:

  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)"

这是我的代码:

- (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 …
Run Code Online (Sandbox Code Playgroud)

objective-c ios firebase firebase-authentication firebase-cloud-messaging

14
推荐指数
1
解决办法
1519
查看次数