小编And*_*rej的帖子

在 Flutter 中使用 Firebase Messaging ^8.0.0-dev.8 收到通知时如何运行函数?

您好,我正在使用 Flutter 构建我的应用程序,每当收到新通知时,我都需要显示警报。
我一直在使用,firebase_messaging 7.0.3但我遇到了一个错误onBackgroundMessage。快速谷歌搜索帮助我发现我遇到的错误尚未修复。然而,其中一位开发人员在 20 天前发布了关于解决该问题的新版本软件包的更新。
新版本删除了旧的 onMessage 处理程序并引入了新的处理程序。现在他们获得了返回流的新事件处理程序,但无法通过使用该.listen()函数来触发它们 。每当我收到通知时,都会收到一个 this:D/FLTFireMsgReceiver(22032): broadcast received for message打印在控制台中,但.listen()没有执行中的代码。

是一篇关于 Firebase Flutter 的文章的链接,该文章是使用新版本软件包的指南。这是我的代码:

...
FirebaseMessaging.onMessage.listen((event) {
 // do something
});
FirebaseMessaging.onMessageOpenedApp.listen((event) {
 // do something
});
FirebaseMessaging.onBackgroundMessage((message) {
 // do something
 return;
 }
...
Run Code Online (Sandbox Code Playgroud)

push-notification android-notifications firebase flutter firebase-cloud-messaging

13
推荐指数
1
解决办法
2510
查看次数

有没有办法使用笔记本电脑摄像头和 Flutter 桌面拍照?

有没有使用笔记本电脑摄像头和 Flutter 桌面(在 Windows 上)拍照的解决方案?我不想使用 go-flutter。

windows dart flutter flutter-desktop

7
推荐指数
1
解决办法
1901
查看次数

尝试在 React Native 中使用 GoogleSignIn 时出现错误:DEVELOPER_ERROR

我已在 Firebase 上启用 Google SignIn,并且还添加了 SHA-1 密钥。我的应用程序编译得很好,但是当我按下登录按钮并选择 Google 帐户进行登录时,我得到了Possible Unhandled Promise Rejection (id: 0): Error: DEVELOPER_ERROR
当我尝试使用匿名登录时我没有收到任何错误。我使用的是 Android,并且所有模块都有最新版本。这是完整的错误代码:

[Fri Oct 23 2020 18:08:26.174]  WARN     Possible Unhandled Promise Rejection (id: 0):
Error: DEVELOPER_ERROR
promiseMethodWrapper@http://localhost:8081/index.bundle?platform=android&dev=true&minify=false:2242:45
signIn$@http://localhost:8081/index.bundle?platform=android&dev=true&minify=false:102709:72
tryCatch@http://localhost:8081/index.bundle?platform=android&dev=true&minify=false:24976:23
invoke@http://localhost:8081/index.bundle?platform=android&dev=true&minify=false:25149:32
tryCatch@http://localhost:8081/index.bundle?platform=android&dev=true&minify=false:24976:23
invoke@http://localhost:8081/index.bundle?platform=android&dev=true&minify=false:25049:30
http://localhost:8081/index.bundle?platform=android&dev=true&minify=false:25059:21
tryCallOne@http://localhost:8081/index.bundle?platform=android&dev=true&minify=false:27056:16
http://localhost:8081/index.bundle?platform=android&dev=true&minify=false:27157:27
_callTimer@http://localhost:8081/index.bundle?platform=android&dev=true&minify=false:30596:17
_callImmediatesPass@http://localhost:8081/index.bundle?platform=android&dev=true&minify=false:30635:17
callImmediates@http://localhost:8081/index.bundle?platform=android&dev=true&minify=false:30852:33
__callImmediates@http://localhost:8081/index.bundle?platform=android&dev=true&minify=false:2736:35
http://localhost:8081/index.bundle?platform=android&dev=true&minify=false:2522:34
__guard@http://localhost:8081/index.bundle?platform=android&dev=true&minify=false:2719:15
flushedQueue@http://localhost:8081/index.bundle?platform=android&dev=true&minify=false:2521:21
flushedQueue@[native code]
callFunctionReturnFlushedQueue@[native code]

Run Code Online (Sandbox Code Playgroud)

这是我的App.js

import React, {useState, useEffect} from 'react';
import {View, Text, Button} from 'react-native';

import auth from '@react-native-firebase/auth';
import firebase from '@react-native-firebase/app';
import {GoogleSignin} from '@react-native-community/google-signin'; …
Run Code Online (Sandbox Code Playgroud)

firebase react-native google-signin react-native-firebase

5
推荐指数
2
解决办法
7777
查看次数