【发布时间】:2018-12-09 23:24:18
【问题描述】:
我正在尝试将我的应用连接到 Firebase。我按照执行此操作的步骤进行操作。我在 Firebase 中创建了一个项目。我下载了 Google services.info 文件。我将我的 pod 文件放入项目中。该项目在 Xcode 中运行,但它不允许我连接到我的 Firebase 项目到服务器。
以下是我收到的错误消息。我什至在 Safari 中清除了我的缓存,但似乎没有任何效果。在我的应用程序委托中,我是否正在尝试测试我的项目以查看是否在 Firebase 数据库中检测到它。以下是我在 Xcode 控制台中收到的错误。
":ResponseBody={
"error": {
"code": 400,
"message": "Permission denied. Could not access bucket sya2-moments-1e2c9.appspot.com. Please enable Firebase Storage for your bucket by visiting the Storage tab in the Firebase Console and ensure that you have sufficient permission to properly provision resources."
}
}, "
代码:
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
FirebaseApp.configure()
let dummyUser = User(uid: "123", username: "myUserNameDummy", bio: "My Dummy User", fullName: "My Dummy User", website: "My Dummy User", follows: [], followedBy: [], profileImage: UIImage(named: "1"))
dummyUser.save { (error) in
print(error)
}
return true
}
}
【问题讨论】:
标签: ios swift firebase firebase-storage