where to provide NSURL value?

只谈情不闲聊 提交于 2021-01-27 14:20:38

问题


Every time I run the app it crashes and the console says:

Terminating app due to uncaught exception 'MissingDatabaseURL', reason: 'Failed to get FirebaseDatabase instance: Specify DatabaseURL within FIRApp or from your databaseForApp:URL: call.

I have the URL I don't know where to place it. I am new to objective C. This is the line that firebase say to use I Just don't know where to place the value of url.

+ (FIRDatabase *)databaseForApp:(FIRApp *)app URL:(NSString *)url 

回答1:


It looks like the GoogleServices-Info.plist file that you downloaded from Firebase does not contain the URL for the database.

There are a few reasons this could be happening:

  • If you are providing the configuration data in code, be sure to set the databaseURL property to the correct value.

  • If you are providing the configuration data through the GoogleServices-Info.plist file, be sure to download a new version of that file after you create the database in the Firebase console and add it to your app as before.

This is a new requirement (since a few weeks ago) as the Realtime Database is now created on-demand (instead of auto-created when the project is created), so that you can pick in what region it's created.

Also see, this question/answer for Android: Firebase : I get in trouble when I sign in with Google



来源:https://stackoverflow.com/questions/65368954/where-to-provide-nsurl-value

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!