【发布时间】:2017-06-04 10:06:06
【问题描述】:
我正在使用电话号码在 iOS 上将 Authenticate 与 Firebase 集成,并且我在此link. 中的文档中提到的过程的初始实施中遇到了错误
我按照他们提到的程序安装了 pod 并导入了 firebase SDK。 错误来自以下两种方法:
func application(_ application: UIApplication, didRegisterForRemoteNotificationsWithDeviceToken deviceToken: Data) {
// Pass device token to auth
Auth.auth().setAPNSToken(deviceToken, type: AuthAPNSTokenTypeProd)
// Further handling of the device token if needed by the app
// ...
}
和
func application(_ application: UIApplication,
didReceiveRemoteNotification notification: [AnyHashable : Any],
fetchCompletionHandler completionHandler: @escaping (UIBackgroundFetchResult) -> Void) {
if Auth.auth().canHandleNotification(notification) {
completionHandler(UIBackgroundFetchResultNoData)
return
}
// This notification is not auth related, developer should handle it.
}
上面写着“使用未解析的标识符'AuthAPNSTokenTypeProd'”和“使用未解析的标识符'UIBackgroundFetchResultNoData'”。
我不确定我在实施中缺少的程序。执行过程我已经走很多遍了,没发现错误。
【问题讨论】:
-
你是在模拟器还是真机上试过这个?
-
我在设备上工作,但这并不重要,因为该项目不会作为编译时错误自行运行。无论如何,如果我从代码中排除这些方法,让方法调配处于活动状态,并继续实施,Firebase Auth 正在工作。但是如果想禁用方法调配,那么我需要编写这些方法,但这是行不通的。
标签: ios firebase swift3 firebase-authentication appdelegate