小编ios*_*os 的帖子

FCM通知在ios中不起作用

我在我的app.i中集成了FCM通知和云消息,其遵循与firebase doc中提到的完全相同的步骤.即使我尝试过FCM提供的示例代码.它只是抛出一些警告<FIRInstanceID/WARNING> Failed to fetch APNS token Error Domain=com.firebase.iid Code=1001 "The operation couldn’t be completed. and <FIRMessaging/WARNING> FIRMessaging registration is not ready with auth credentials.

任何人都可以帮我解决它.我正在谷歌搜索一周,但没有任何帮助我得到.我用Appdelegate.m编写的代码是

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
    // Register for remote notifications
    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 …
Run Code Online (Sandbox Code Playgroud)

objective-c ios

6
推荐指数
1
解决办法
9139
查看次数

标签 统计

ios ×1

objective-c ×1