我正在尝试创建一个应用程序来使用 Chewie 播放 Firebase 数据库中的视频。如果我播放资产视频,它工作正常,但如果我尝试从 firebase 获取 YouTube 视频,它会显示白色拒绝符号,我尝试了不同的视频源,它可以工作,但我的目标是访问 YouTube 视频。我使用了真实的设备,在 Android 和 IOS 上都尝试过,但没有任何效果。有什么解决办法吗?
因此,我在我的 futter 应用程序上启用了 firebase 消息传递,一切正常,但是,当我在应用程序中收到通知时,它不会发出声音或振动,无论是 android 还是 ios。我相信 FCM 默认情况下会执行此操作,我也有“IosNotificationSettings(声音:true,徽章:true,alert:true)”,但通知只是静音。你们知道会发生什么吗?我搜索了这种情况,但找不到任何相关信息。在此先感谢您的帮助。
class _HomeScreenState extends State<HomeScreen>
with SingleTickerProviderStateMixin {
String _homeScreenText = "Waiting for token...";
final FirebaseMessaging _firebaseMessaging = FirebaseMessaging();
static const String contato = "contato";
TabController _tabController;
@override
void initState() {
_tabController = new TabController(length: 5, vsync: this);
super.initState();
_firebaseMessaging.configure(
onMessage: (Map<String, dynamic> message) {
print('on message $message');
},
onResume: (Map<String, dynamic> message) {
print('on resume $message');
},
onLaunch: (Map<String, dynamic> message) {
print('on launch $message');
},
);
_firebaseMessaging.requestNotificationPermissions(
const IosNotificationSettings(sound: …Run Code Online (Sandbox Code Playgroud) 我正在尝试在我的应用程序上设置电话身份验证,但我遇到了这个错误“'(FirebaseUser) 类型的值?Null' 无法分配给类型为 '(AuthCredential) 的变量?void'。” . 关于如何解决它的任何想法?在此先感谢您的帮助!
class _AuthScreenState extends State<AuthScreen> {
String phoneNo;
String smsCode;
String verificationId;
Future<void> verifyPhone() async {
final PhoneCodeAutoRetrievalTimeout autoRetrieve =(String verId) {
this.verificationId = verId;
};
final PhoneCodeSent smsCodeSent = (String verId, [int
forceCodeResend]){
this.verificationId = verId;
};
final PhoneVerificationCompleted verifiedSuccess = (FirebaseUser
user) {
print("Verificado");
};
final PhoneVerificationFailed verifiedFailed = (AuthException
exception) {
print("${exception.message}");
};
await FirebaseAuth.instance.verifyPhoneNumber(
phoneNumber: this.phoneNo,
timeout: const Duration(seconds: 5),
verificationCompleted: verifiedSuccess,
verificationFailed: verifiedFailed,
codeSent: smsCodeSent,
codeAutoRetrievalTimeout: autoRetrieve);
}
Run Code Online (Sandbox Code Playgroud) 我正在尝试详细说明一个函数,当按下图标时,firebase 数字会增加 1,当再次按下图标时,它会增加 -1 并且它会显示总喜欢返回为“Text()”。 toString()”。我正在尝试使用“FieldValue.increment”,但不幸的是,firebase 上的数字没有增加。我究竟做错了什么?在此先感谢您的帮助!
class LanchonetesContact extends StatefulWidget {
final DocumentSnapshot lanchonetes;
LanchonetesContact(this.lanchonetes);
@override
_LanchonetesContactState createState() =>
_LanchonetesContactState();
}
class _LanchonetesContactState extends State<LanchonetesContact> {
bool liked = false;
_pressed() {
setState(() {
liked = !liked;
});
}
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
leading: IconButton(
icon: Icon(Icons.arrow_back),
onPressed: () {
Navigator.pop(context);
}),
title: Text("Lanchonetes"),
centerTitle: true,
backgroundColor: Colors.purple[900],
actions: <Widget>[
IconButton(
icon: Icon(
liked ? Icons.favorite : Icons.favorite_border,
color: Colors.white,) ,
onPressed: () { …Run Code Online (Sandbox Code Playgroud)