所以我的火力地堡推送通知不工作在iOS(模拟器+我没有一个开发者账户,也许这是已经是一个什么原因呢?)火力地堡推送通知不工作
我做了什么:
- 创建于谷歌火力地堡的应用程序(我觉得我没加指纹,因为我没有它尚未)
- 添加火力地堡/ FirebaseMessaging我Podfile
- 新增GoogleService-的Info.plist到我的项目目录
- 新增钥匙扣共享的功能
- 添加以下代码,以我的应用程序代表:
这里是我的代码:
import Firebase
import UserNotifcations
import Firebase
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
FIRApp.configure()
let center = UNUserNotificationCenter.current()
center.requestAuthorization(options: [.badge, .alert, .sound] {(granted, error) in}
application.registerForRemoteNotifications()
return true;
}
}
任何错误?我错过了什么?是因为我没有开发者帐户,或者是模拟器无法接收推送通知?任何帮助,将不胜感激!