在哪里提供NSURL值? [英] where to provide NSURL value?

查看:44
本文介绍了在哪里提供NSURL值?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

每次我运行该应用程序时,它都会崩溃,并且控制台会显示:

由于未捕获的异常"MissingDatabaseURL"而终止应用程序,原因:无法获取FirebaseDatabase实例:在FIRApp内或从您的databaseForApp:URL:调用中指定DatabaseURL.

我有一个我不知道将其放置在哪里的URL.我是目标C的新手.这是firebase说要使用的那行,我只是不知道将url值放在何处.

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

解决方案

从Firebase下载的 GoogleServices-Info.plist 文件似乎不包含数据库的URL.

有几种原因可能导致这种情况发生:

  • 如果要通过代码提供配置数据,请确保设置 Firebase:使用Google登录时遇到麻烦

    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 
    

    解决方案

    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

    这篇关于在哪里提供NSURL值?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆