所以我的火力地堡推送通知不工作在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;
}
}
任何錯誤?我錯過了什麼?是因爲我沒有開發者帳戶,或者是模擬器無法接收推送通知?任何幫助,將不勝感激!