我正在尝试使用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
}
答案 0 :(得分:1)
您的应用是否已发布到App Store?我曾经遇到过类似的问题。
请在http://developer.apple.com上查看您的帐户,并确保在“推送通知”下启用“开发者”和“发布”。
另请确保您已在“云端消息”下的“Firebase设置”页面上上载了“开发和分发”证书。