Firebase错误:您必须在控制台中启用此服务

问题描述 投票:1回答:4

我在尝试创建用户时收到以下错误

注意:这篇文章可能看起来很长,但总的来说我认为它主要是在控制台中安装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身份验证中,我已使用电子邮件和密码启用了注册

enter image description here

我已经在文档中提到了更改,即在我的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的文件夹结构如下所示

enter image description here

我在指令中做的一件事就是创造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

这是额外的(可能是相关的截图

enter image description here enter image description here enter image description here

更新2:我的应用程序也未经过验证

enter image description here

另外,我们是否需要为应用添加任何网址?

ios firebase react-native react-native-firebase
4个回答
1
投票

您可以跳过上面的验证步骤,但需要在以下配置下进行以下配置:

enter image description here

你需要正确配置app idbundle id

enter image description here

As explained in my post on github firebase在您的谷歌云控制台中创建三个API密钥。

你的ios应用程序的一个api密钥,一个用于你的android应用程序(你没有这个)和一个用于web的api密钥。

enter image description here

enter image description here

我将来会不断更新这些帖子,以下是我一直在检查您的问题的一些链接

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

Firebase Authentication error in android


0
投票

您的问题是您没有在项目中包含google-services.json文件。转到firebase上的设置并下载然后添加到项目中。

To download a config file for an Android app:

  • 登录Firebase,然后打开您的项目。
  • 单击,然后选择项目设置。
  • 在您的应用程序卡中,选择您需要配置文件的应用程序的程序包名称。
  • 点击google-services.json,然后将其添加到您的应用中。

0
投票

我知道这不是文件中描述的......但这对我有用!我看到你在项目文件夹中添加了GoogleService-Info.plist,但是我在ios文件夹下导入了它。只需将其添加到“ios”文件夹中即可连接到控制台。 :-)当然你需要再次清理和运行你的项目。


-1
投票

您只需要从控制台启用google登录方法,以获取更多参考检查以下屏幕截图。

enter image description here

enter image description here

© www.soinside.com 2019 - 2024. All rights reserved.