更改Firebase的包ID [英] Changing bundle ID for Firebase
问题描述
com
。现在我准备好测试航班了,并且我有一个无效的包标识符。 目前,我的包标识符是 mycompany.myProject
但我希望它是 com.mycompany.myproject
。我没有任何问题切换到所需的捆绑ID的归档应用程序,并上传到应用程序商店。
我将应用程序切换到相应的包标识符的步骤:
- 使用正确的套件ID在Firebase控制台中创建新的应用程序。
- 下载这个新应用程序的Google-Info.plist并将其放置在项目的根目录下并拖放到Xcode项目中。
- 在Facebook上更改包标识符 li>
- 在项目设置中更改包标识符
然而,应用程序崩溃致命的错误。 p>
***由于未捕获异常InvalidPathValidation,终止应用程序,原因:'(child :)必须是非空字符串不包含'。''''''''''''''或']''
<在这个错误发生的时候,Firebase方法被称为
$ $ $ $ $ $ $ $ $ $ $ $ return $ {
$返回[FIRAuth AUTH] .currentUser.uid;
这个方法返回 nil
提供从Firebase检索数据的方法。此方法的 nil
返回将导致 InvalidPathValidation
错误。
我正在与Facebook进行身份验证。我想也许这是返回的原因 nil
是应用程序不知道谁登录,因为我从来没有提示登录(我的应用程序检查,如果您登录通过Facebook在 viewWillAppear
上打开ViewController)。然而,这是没有道理的,因为我所做的唯一更改就是更改包ID。我一直被困在这个问题上差不多一个星期。
我特别想知道我需要更改Firebase以接受包标识符更改。解决方案
解决方案是在同一个firebase项目中创建一个新的应用程序
Early on in this project I made the error of not having the prefix com
in the bundle identifier. Now I am ready to test flight and I have an invalid bundle identifier.
Currently, my bundle identifier is mycompany.myProject
but I want it to be com.mycompany.myproject
. I have no problem switching to the desired bundle id for archiving the app and uploading to the app store.
The steps I took to switch the app to the appropriate bundle identifier:
- Create new app in firebase console with correct bundle ID.
- Download Google-Info.plist of this new app and place in projects root and drag into Xcode project.
- Change bundle identifier on Facebook
- Change bundle identifier in project settings
However, the app crashes fatally with this error.
*** Terminating app due to uncaught exception 'InvalidPathValidation', reason: '(child:) Must be a non-empty string and not contain '.' '#' '$' '[' or ']''
The point at which this error arises is when a Firebase method is called
- (NSString *) getUid {
return [FIRAuth auth].currentUser.uid;
}
This method returns nil
which feeds a method for retrieving data from Firebase. This method's nil
return causes the InvalidPathValidation
error.
I am authenticating with Facebook. I thought maybe the reason this is returning nil
is that the app doesn't know who is logged in, because I was never prompted to login (my app checks if your logged in through Facebook in viewWillAppear
on the opening ViewController). However this doesn't make sense because the only change I made was changing the bundle ID. I have been stuck on this problem for almost a week.
I am specifically wondering what do I need to change for Firebase to accept the bundle identifier changes.
The solution was to create a new app within the same firebase project
这篇关于更改Firebase的包ID的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!