当我运行时,firebase deploy我收到此错误消息:
functions: HTTP Error: 400, Change of function trigger type or event provider is not allowed
Run Code Online (Sandbox Code Playgroud)
在我的控制器下,firebase deploy我收集firebase deploy,然后在用户登录时将其更新到数据库位置.此代码工作正常:
functions: HTTP Error: 400, Change of function trigger type or event provider is not allowed
Run Code Online (Sandbox Code Playgroud)
这是我的云功能.它旨在在用户登录时触发,这会更新Firebase数据库中的位置.然后,该函数向IBM Watson发送HTTP请求以获取令牌,然后将令牌写入文件.该功能从Node正常运行.触发器似乎是问题所在.
functions: HTTP Error: 400, Change of function trigger type or event provider is not allowed
Run Code Online (Sandbox Code Playgroud) 我可以users使用电子邮件地址查询我的数组并返回用户的帐户信息:
users.orderByChild('email').equalTo(authData.user.email).once('value').then(function(snapshot) {
console.log(snapshot.val());
console.log(snapshot.key); // 'users'
console.log(snapshot.child('email').key); 'email'
...
Run Code Online (Sandbox Code Playgroud)
我如何获得密钥(-KiBBDaj4fBDRmSS3j0r).snapshot.key回报users.snapshot.child('email').key回报email.关键似乎没有要个孩子,即,它似乎与在users和email.
该文件说:
您可以使用 onSnapshot() 方法收听文档。使用您提供的回调的初始调用会立即使用单个文档的当前内容创建文档快照。然后,每次内容更改时,另一个调用都会更新文档快照。
我只希望我的听众在数据更改时触发。我不希望它在应用程序加载时触发,以获取数据的初始状态。有什么建议?
我正在尝试使用file.getSignedUrl()通过Google Cloud Functions(Nodejs)从Firebase Storage获取下载URL.我在Cloud Functions控制台中收到此错误:
{ SigningError: A Forbidden error was returned while attempting to retrieve an access token for the Compute Engine built-in service account. This may be because the Compute Engine instance does not have the correct permission scopes specified. Permission iam.serviceAccounts.signBlob is required to perform this operation on service account projects/myapp-cd94d/serviceAccounts/myapp-cd94d@appspot.gserviceaccount.com.
at SigningError (/user_code/node_modules/@google-cloud/storage/build/src/file.js:58:9)
at authClient.sign.then.catch.err (/user_code/node_modules/@google-cloud/storage/build/src/file.js:1019:22)
at process._tickDomainCallback (internal/process/next_tick.js:135:7) name: 'SigningError' }
Run Code Online (Sandbox Code Playgroud)
我将代码从添加Firebase Admin SDK复制到您的服务器文档中.serviceAccountKey.json我的functions文件夹里有我的.firebase …
该文件是太复杂了,我听不懂。它展示了如何将文件从 Cloud Storage 下载到 Cloud Functions,操作该文件,然后将新文件上传到 Cloud Storage。我只想查看将文件从 Cloud Functions 上传到 Cloud Storage 的基本、最低限度的说明。为什么这不起作用:
const functions = require('firebase-functions');
const admin = require('firebase-admin');
admin.initializeApp();
exports.storage = functions.firestore.document('Test_Value').onUpdate((change, context) => {
var metadata = {
contentType: 'text',
};
admin.storage().ref().put( {'test': 'test'}, metadata)
.then(function() {
console.log("Document written.");
})
.catch(function(error) {
console.error(error);
})
});
Run Code Online (Sandbox Code Playgroud)
错误信息是admin.storage(...).ref is not a function。我猜这firebase-admin包括 Firestore 但不包括 Storage?而不是firebase-admin我应该使用@google-cloud/storage?为什么这不起作用:
const functions = require('firebase-functions');
const admin = require('firebase-admin');
const {Storage} = require('@google-cloud/storage')(); …Run Code Online (Sandbox Code Playgroud) 我看到如何在用户帐户创建时执行云功能:
exports.myFunction = functions.auth.user().onCreate(event => {
Run Code Online (Sandbox Code Playgroud)
但是我需要在用户登录时执行我的函数。有onLogin触发器吗?
有 1500 分的人可以创建一个标签firebase-cloud-functions吗?
问题可能是 Android Studio 找不到 CocoaPods 的路径吗?
\n我正在尝试通过 Android Studio 在 iPhone 上测试我的应用程序。我得到的错误是
\nWarning: CocoaPods not installed. Skipping pod install.\n CocoaPods is used to retrieve the iOS and macOS platform side's plugin code that responds to your plugin usage on the Dart side.\n Without CocoaPods, plugins will not work on iOS or macOS.\n For more info, see https://flutter.dev/platform-plugins\nTo install see https://guides.cocoapods.org/using/getting-started.html#installation for instructions.\n\nException: CocoaPods not installed or not in valid state.\nRun Code Online (Sandbox Code Playgroud)\n我跑了gem list并安装了 gem 的列表包括:
我正在尝试将我的 Flutter 应用程序部署到 Android。根据 Flutter 文档,我们必须对我们的应用程序进行签名。第一步是创建一个upload keystore. 有两种方法可以做到这一点。
第一种方法使用Android Studio。说明说:
In the menu bar, click Build > Generate Signed Bundle/APK.
Run Code Online (Sandbox Code Playgroud)
Build这是Bumblebee 2021.1.1的屏幕截图:
哪里Generate Signed Bundle/APK?
我点击了Build > Flutter > Build App Bundle。这运行了一段时间并完成,没有错误消息。
第二种方法使用 CLI。您输入以下内容(在 Mac 或 Linux 上):
keytool -genkey -v -keystore ~/upload-keystore.jks -keyalg RSA -keysize 2048 -validity 10000 -alias upload
Run Code Online (Sandbox Code Playgroud)
这促使我进行了keystore password. 那是什么?我在哪里可以得到它?
我应该upload-keystore.jks在我的主目录中看到一个文件。这是否意味着在我的项目的主目录或我的用户的主目录中?我没有看到那个文件。
接下来,我被告知
Create a file named [project]/android/key.properties that contains a reference to your …Run Code Online (Sandbox Code Playgroud) 我的 Flutter 应用程序在 Chrome(网络)模拟器中看起来很棒,并且在本地服务器上运行。
\n我导航到这个目录:
\nUsers/TDK/StudioProjects/kabbalah/build/web/\n\nRun Code Online (Sandbox Code Playgroud)\n我安装了 Firebase CLI 工具,然后运行
\nfirebase init hosting\nRun Code Online (Sandbox Code Playgroud)\n我不确定这个问题:
\n? Configure as a single-page app (rewrite all urls to /index.html)? (y/N) \nRun Code Online (Sandbox Code Playgroud)\n我回答了y。回应是
\xe2\x9c\x94 Firebase initialization complete!\nRun Code Online (Sandbox Code Playgroud)\n然后我跑了
\nfirebase deploy --only hosting\nRun Code Online (Sandbox Code Playgroud)\n响应是
\n\xe2\x9c\x94 Deploy complete!\n\nProject Console: https://console.firebase.google.com/project/kabbalah-numerology/overview\nHosting URL: https://kabbalah-numerology.web.app\nRun Code Online (Sandbox Code Playgroud)\n当我进入项目控制台时,我看到
\nDeployed\nRun Code Online (Sandbox Code Playgroud)\n当我去时,https://kabbalah-numerology.web.app我看到这个屏幕:
我不应该看到我的网络应用程序吗?我是从错误的目录部署的吗?
\n我打开 Safari 来检查 Chrome 是否正在缓存旧网页,但我得到了相同的屏幕。
\n我将此代码块放入index.html. …
我将 Node 模块rxfire从 6.0.3 更新到 6.0.4,firebase从 9.23.0 更新到 10.3.0。现在我的 Angular 应用程序无法启动。我运行npm install rxfire@6.0.3并npm install firebase@9.23.0恢复到旧的 Node 模块,但错误仍然存在。我还删除了我的节点模块并运行了npm install.
错误是:
FirebaseError: Firebase: No Firebase App '[DEFAULT]' has been created - call initializeApp() first (app/no-app).
Run Code Online (Sandbox Code Playgroud)
StackOverflow 的多个页面回答了命名空间 Firebase 的这个问题,而不是模块化 Firebase 的问题。
这是我的app.module.ts文件:
FirebaseError: Firebase: No Firebase App '[DEFAULT]' has been created - call initializeApp() first (app/no-app).
Run Code Online (Sandbox Code Playgroud)
错误是说我需要把initializeApp(environment.firebase))一切放在第一位。它位于 的顶部imports。
该错误还表明它正在尝试连接到名为 的 Firebase 应用程序[DEFAULT]。我的 Firebase 项目名为 …
firebase ×7
flutter ×2
android ×1
angular ×1
angularfire ×1
cocoapods ×1
flutter-web ×1
google-play ×1
ios ×1
javascript ×1
node.js ×1
xcode ×1