在自定义创建的Xcode框架中,如果不添加GoogleService-Info.plist文件,仍然可以使用Firebase推送通知服务。以下是一种可能的解决方案:
import Firebase
import FirebaseMessaging
class PushNotificationManager {
static func configure() {
FirebaseApp.configure()
Messaging.messaging().delegate = self
Messaging.messaging().shouldEstablishDirectChannel = true
// TODO: 添加其他推送通知配置
}
}
extension PushNotificationManager: MessagingDelegate {
func messaging(_ messaging: Messaging, didReceiveRegistrationToken fcmToken: String?) {
// 在这里处理注册令牌的逻辑
}
// 处理其他推送通知相关的委托方法
}
至此,你已经在自定义创建的Xcode框架中成功配置了Firebase推送通知服务,而不需要添加GoogleService-Info.plist文件。
需要注意的是,上述解决方案仅适用于使用Firebase的推送通知服务。对于其他Firebase功能(如实时数据库、认证等),可能需要添加GoogleService-Info.plist文件以获得完整的功能支持。
领取专属 10元无门槛券
手把手带您无忧上云