【问题标题】:iOS app not receiving Firebase notificationsiOS 应用未收到 Firebase 通知
【发布时间】:2017-12-24 01:42:46
【问题描述】:

我有一个 iOS 10 应用程序,我正在尝试在其中设置对 Firebase 通知的支持。但是,当通过 Firebase 云消息传递控制台(针对所有 iOS 设备)发送消息时,通知不会出现在我的设备上。

我做了什么:

通过 Firebase 控制台发送通知后,我可以看到它已发送到“0”个设备。

谁能给点建议?

【问题讨论】:

  • 您是否已将 firebase 控制台中可用的 .plist 文件放入应用项目文件中?

标签: ios objective-c firebase firebase-cloud-messaging firebase-notifications


【解决方案1】:

已通过在 GoogleService-Info.plist 文件中添加 FirebaseAppDelegateProxyEnabled 并将其设置为 NO 进行修复。然后修改 AppDelegate.m 以使用非混合方法。

【讨论】:

    【解决方案2】:

    在您的应用程序代码中检查以下内容:

    1) 在 Firebase 中检查您的证书和包标识符。

    2) 确保将设备令牌发送到 Firebase。

    - (void)application:(UIApplication *)application
       didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken {
    
    // For Development
        [FIRInstanceID instanceID] setAPNSToken:deviceToken type:FIRInstanceIDAPNSTokenTypeSandbox];
    
    // For Production
        [FIRInstanceID instanceID] setAPNSToken:deviceToken type: FIRInstanceIDAPNSTokenTypeProd];
    
        }
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-04-19
      • 2020-08-17
      • 2021-05-01
      • 2020-07-16
      • 2021-12-10
      • 1970-01-01
      相关资源
      最近更新 更多