ios - Firebase 错误:您必须在控制台中启用此服务
问题描述
尝试创建用户时出现以下错误
注意:这篇文章可能看起来很长,但总的来说我认为它主要是在控制台中安装 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,为此我需要它与应用程序一起本地工作
更新:捆绑标识符也可能有错误?
查看-tvOS
包标识符时,恰好是这个 org.reactjs.native.example.entreClientwithoutExpo-tvOS
但通常是
app.entre
这是附加的(可能是相关的屏幕截图
更新 2:我的应用也没有经过验证
另外,我们是否需要为应用添加任何 URL?
解决方案
您可以跳过上面的验证步骤,但您需要在下面进行以下配置:
您需要正确配置app id
和bundle id
.
正如我在 github 上的帖子中所解释的那样, firebase 在您的谷歌云控制台中创建了三个 api 密钥。
一个 api 密钥用于您的ios
应用程序,一个用于您的android
应用程序(您没有这个),一个 api 密钥用于web
.
以后我会继续更新这篇文章,这里有一些我一直在检查你的问题的链接
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
推荐阅读
- resolution - 视口拉伸模式问题
- python - 如何告诉 PyCharm 异步夹具返回了一些东西
- netlogo - 创建补丁的“行程”代理集
- c++ - 为什么我的循环是无限的?我用91测试过
- jenkins - Jenkins hashicorp-vault-plugin empty result
- amazon-s3 - CloudFront 签名 url 的最长过期时间是多少
- sql-server - 链接服务器的参数化查询
- three.js - 如何在 ThreeJS 中查找给定对象是否正在接收阴影?
- c# - Sharepoint CSOM 版本冲突
- python-3.x - 对给定问题的输出的解释