Notification Sending Side Using Dio flutter Library to make http post request
step1 : Get api key from firebase console under firebase messaging s...
For further actions, you may consider blocking this person and/or reporting abuse
final headers = {
'content-type': 'application/json',
'Authorization': 'key=AAAAY2mZqb4:APA91bH38d3b4mgc4YpVJ0eBgDez1jxEzCNTq1Re6sJQNZ2OJvyvlZJYx7ZASIrAj1DnSfVJL-29qsyPX6u8MyakmzlY-MRZeXOodkIdYoWgwvPVhNhJmfrTC6ZC2wG7lcmgXElA6E09'
};
get this key from firebase project under firebase massaging
hii please can you help me
i want to send notification to specific users
i did what you did but i am getting http status error [520]
this error means you are being sent an empty response. there is something that you are missing in the request.
please ensure these points
checklist
Now i am getting on the terminal that fcm request for device sent but i am not getting any notificstion
configure receiving end well. there might be issues on receiving end now
How can i solve it?
logout and relogin on receiving device, make sure token is same and valid. in console you can print out if it is inside onlaunch ,onMessage or onResume if one of these methods is getting triggered on receiver app that means something is wrong with your implementation
share a screenshot of your console
Can you show me a sample code about it?
_fcm.configure(
onMessage: (Map message) async {
print("onMessage: $message");
showDialog(
context: context,
builder: (context) => AlertDialog(
content: ListTile(
title: Text(message['notification']['title']),
subtitle: Text(message['notification']['body']),
),
actions: [
FlatButton(
child: Text('Ok'),
onPressed: () => Navigator.of(context).pop(),
),
],
),
);
},
onLaunch: (Map message) async {
print("onLaunch: $message");
// TODO optional
},
onResume: (Map message) async {
print("onResume: $message");
// TODO optional
},
);
Where i put these stuff?!!
in your home page initstate method
Nice Stuff...
fcm.googleapis.com/fcm/send
Hi i need explain deeply.Can u help me