Firebase通知仅出现在一台设备上

时间:2017-08-08 13:35:36

标签: ios swift firebase firebase-notifications

我正在尝试使用Firebase首次将通知集成到我的应用开发中。我的问题是通知似乎只在我的设备上接收而没有其他人的设备。我仔细检查了.p12文件是Apple推送服务的挑衅。有任何想法吗??在此先感谢

func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {

    let notificationTypes: UIUserNotificationType = [UIUserNotificationType.alert, .badge, .sound]

    let pushNotificationSettings: UIUserNotificationSettings = UIUserNotificationSettings(types : notificationTypes, categories: nil)
    application.registerUserNotificationSettings(pushNotificationSettings)
    application.registerForRemoteNotifications()

    FirebaseApp.configure()

    NotificationCenter.default.addObserver(self, selector: Selector(("tokenRefreshNotification:")), name: NSNotification.Name.InstanceIDTokenRefresh, object: nil)

    return true
}

1 个答案:

答案 0 :(得分:1)

您的应用是否已发布到App Store?我曾经遇到过类似的问题。

请在http://developer.apple.com上查看您的帐户,并确保在“推送通知”下启用“开发者”和“发布”。

enter image description here

另请确保您已在“云端消息”下的“Firebase设置”页面上上载了“开发和分发”证书。

enter image description here