我在尝试创建用户时收到以下错误
注意:这篇文章可能看起来很长,但总的来说我认为它主要是在控制台中安装firebase的指令。
不允许此操作。您必须在控制台中启用此服务。
我在iPhone X设备上尝试这个可能在模拟器中运行最新的ios。
我正在使用react-native-firebase模块
这就是我的注册操作的样子
import firebase from "react-native-firebase";
export const signup = (fullName, username, email, password) => {
console.log(`Full name: ${fullName} UserName: ${username} email: ${email} password: ${password}`)
return function(dispatch) {
dispatch({ type: PROFILE_LOADING });
firebase
.auth()
.createUserWithEmailAndPassword(email, password)
.then(user => {
console.log("This is user from signup", signup);
return dispatch({
type: PROFILE_SUCCESS,
payload: user
});
})
.catch(error => {
console.error(error)
return dispatch({
type: PROFILE_ERROR,
payload: error.data
});
});
};
};
在我的firebase身份验证中,我已使用电子邮件和密码启用了注册
我已经在文档中提到了更改,即在我的AppDelegate.m
中
#import "AppDelegate.h"
#import <React/RCTBundleURLProvider.h>
#import <React/RCTRootView.h>
#import <Firebase.h>
@implementation AppDelegate
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
[FIRApp configure];
// more code
我的pod文件看起来像这样
# Pods for entreClientwithoutExpo
pod 'Firebase/Core'
pod 'Firebase/Auth'
target 'entreClientwithoutExpo-tvOSTests' do
inherit! :search_paths
# Pods for testing
pod 'RNVectorIcons', :path => '../node_modules/react-native-vector-icons'
pod 'RNReanimated', :path => '../node_modules/react-native-reanimated'
end
我的包含GoogleService-Info.plist
的文件夹结构如下所示
我在指令中做的一件事就是创造rn-cli.config.js
const blacklist = require('metro-config/src/defaults/blacklist');
module.exports = {
resolver:{
blacklistRE: blacklist([
/nodejs-assets\/.*/,
/android\/.*/,
/ios\/.*/
])
},
};
问题:任何想法我可能做错了什么?
更新:使用基于Web的登录,它可以正常工作,但我打算使用firebase firestore,为此我需要它本地与app一起工作
更新:捆绑标识符也可能出错?
当查看-tvOS
包标识符时,碰巧是这个org.reactjs.native.example.entreClientwithoutExpo-tvOS
但通常是
app.entre
这是额外的(可能是相关的截图
更新2:我的应用程序也未经过验证
另外,我们是否需要为应用添加任何网址?
您可以跳过上面的验证步骤,但需要在以下配置下进行以下配置:
你需要正确配置app id
和bundle id
。
As explained in my post on github firebase在您的谷歌云控制台中创建三个API密钥。
你的ios
应用程序的一个api密钥,一个用于你的android
应用程序(你没有这个)和一个用于web
的api密钥。
我将来会不断更新这些帖子,以下是我一直在检查您的问题的一些链接
https://invertase.io/oss/react-native-firebase/guides
https://duckduckgo.com/?q=medium+react+native+firebase+configuring+ios&t=canonical&ia=web
https://duckduckgo.com/?q=medium+react+native+firebase+configuring+ios&t=canonical&ia=web
https://firebase.googleblog.com/2016/01/the-beginners-guide-to-react-native-and_84.html
您的问题是您没有在项目中包含google-services.json
文件。转到firebase上的设置并下载然后添加到项目中。
To download a config file for an Android app:
我知道这不是文件中描述的......但这对我有用!我看到你在项目文件夹中添加了GoogleService-Info.plist
,但是我在ios文件夹下导入了它。只需将其添加到“ios”文件夹中即可连接到控制台。 :-)当然你需要再次清理和运行你的项目。