我试图在点击推送通知时实现打开特定屏幕,我的有效负载如下所示:
var payload = {
notification: {
title: notificationTitle,
body: notificationMessage,
click_action:"/screena",sound:"default",
}
};
Run Code Online (Sandbox Code Playgroud)
我收到通知但我无法捕捉到flutter中的通知点击事件如何捕获它.我正在使用扑动消息
https://github.com/flutter/plugins/tree/master/packages/firebase_messaging
和我的firebase推送消息服务代码看起来像这样
pushMessagingService() async{
messagingreference.configure(
onMessage: (Map<String, dynamic> message) {
print("I am here in on message");
print(message);
},
onLaunch: (Map<String, dynamic> message) {
print("I am here onLaunch");
print(message);
},
onResume: (Map<String, dynamic> message) {
print("I am hereonResume");
print(message);
},
);
messagingreference.requestNotificationPermissions(
const IosNotificationSettings(sound: true, badge: true, alert: true));
messagingreference.onIosSettingsRegistered
.listen((IosNotificationSettings settings) {
print("Settings registered: $settings");
});
messagingreference.getToken().then((String token) async {
print(token);
});
}
Run Code Online (Sandbox Code Playgroud)
这里我可以得到消息,因为@xqwzts在我的应用程序处于前台时在消息中说,但我的问题是如何从系统托盘中引发的推送通知中捕获点击事件并导航到所需的屏幕.
嗨我想在flutter中实现推送通知如何显示为通知可以任何一个帮助,我能够听,因为我收到通知但我无法看到消息,它显示为警报,但我想作为通知可以任何一个帮助,在Android或iOS我们应该在清单文件和应用程序委托文件中的这个在颤动
我的代码看起来像这样
class PushMessagingExample extends StatefulWidget {
@override
_PushMessagingExampleState createState() => new _PushMessagingExampleState();
}
class _PushMessagingExampleState extends State<PushMessagingExample> {
String _homeScreenText = "Waiting for token...";
bool _topicButtonsDisabled = false;
final FirebaseMessaging _firebaseMessaging = new FirebaseMessaging();
final TextEditingController _topicController =
new TextEditingController(text: 'topic');
Future<Null> _showItemDialog(Map<String, dynamic> message) async {
final Item item = _itemForMessage(message);
showDialog<Null>(
context: context,
child: new AlertDialog(
content: new Text("Item ${message} has been updated"),
actions: <Widget>[
new FlatButton(
child: const Text('CLOSE'),
onPressed: () {
Navigator.pop(context, false);
}),
new …Run Code Online (Sandbox Code Playgroud) 如何获得选择下拉的下拉列表,
在dropdown按钮中没有获取选定索引的属性,如果有如何获取所选索引,我的代码如下所示:
new DropdownButton( hint:new Text("Select a users"),value: selectedUser,
onChanged: (String newValue) {
setState(() {
selectedUser = newValue;
});
},
items: userInfoToMap.map((ListOfUsers value) {
return new DropdownMenuItem<String>(
value: value.name,
child:new Text(value.name,style: new TextStyle(color: Colors.black))
);
})
.toList(),
),
),),
Run Code Online (Sandbox Code Playgroud) 嗨,我正在尝试使用图像库减小从图库中选取的图像大小,同时尝试遇到这样的错误
E/flutter (13796): [ERROR:lib/tonic/logging/dart_error.cc(16)] Unhandled exception:
E/flutter (13796): FileSystemException: Cannot open file, path = 'file:///storage/emulated/0/WhatsApp/Media/WhatsApp%20Images/IMG-20171016-WA0020.jpg' (OS Error: No such file or directory, errno = 2)
E/flutter (13796): #0 _File.throwIfError (file_impl.dart:618)
E/flutter (13796): #1 _File.openSync (file_impl.dart:473)
E/flutter (13796): #2 _File.readAsBytesSync (file_impl.dart:533)
E/flutter (13796): #3 _AddNewUserState.qqq (/data/data/com.prayuta.chitfunds/cache/chitfundsUNFPRG/chitfunds/lib/users.dart:420:97)
E/flutter (13796): <asynchronous suspension>
E/flutter (13796): #4 _AddNewUserState.build.<anonymous closure> (/data/data/com.prayuta.chitfunds/cache/chitfundsUNFPRG/chitfunds/lib/users.dart:686:19)
E/flutter (13796): #5 GestureRecognizer.invokeCallback (package:flutter/src/gestures/recognizer.dart:102:24)
E/flutter (13796): #6 TapGestureRecognizer._checkUp (package:flutter/src/gestures/tap.dart:149:9)
E/flutter (13796): #7 TapGestureRecognizer.acceptGesture (package:flutter/src/gestures/tap.dart:119:7)
E/flutter (13796): #8 GestureArenaManager.sweep (package:flutter/src/gestures/arena.dart:156:27)
E/flutter (13796): #9 BindingBase&SchedulerBinding&GestureBinding.handleEvent (package:flutter/src/gestures/binding.dart:147:20) …Run Code Online (Sandbox Code Playgroud) 我可以通过身份验证与用户登录,但是如何获得当前用户的帮助。
我正在尝试这种方式
FirebaseUser user = FirebaseAuth.instance.currentUser;
print(user.uid);
Run Code Online (Sandbox Code Playgroud)
但显示为
无法将类型'()-> Future类型的值分配给firebaseuser类型的变量“
如何在Firebase中发送验证邮件并在Firebase Flutter版本中忘记密码链接
firebase_auth插件,我找不到任何忘记密码的方法,是否有其他两种方法