DEV Community

how to send push notification to particular user using fcm (firebase Messaging) and Flutter

zeeshan mehdi on April 13, 2020

Notification Sending Side Using Dio flutter Library to make http post request step1 : Get api key from firebase console under firebase messaging s...
Collapse
 
zeeshanmehdi profile image
zeeshan mehdi •

final headers = {
'content-type': 'application/json',
'Authorization': 'key=AAAAY2mZqb4:APA91bH38d3b4mgc4YpVJ0eBgDez1jxEzCNTq1Re6sJQNZ2OJvyvlZJYx7ZASIrAj1DnSfVJL-29qsyPX6u8MyakmzlY-MRZeXOodkIdYoWgwvPVhNhJmfrTC6ZC2wG7lcmgXElA6E09'
};

get this key from firebase project under firebase massaging

Collapse
 
roshdialmajzoub profile image
roshdiAlMajzoub •

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]

Thread Thread
 
zeeshanmehdi profile image
zeeshan mehdi •

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

  • header
  • token ( of receivers device)
  • fcm send url is valid
  • body is in the json format
Thread Thread
 
roshdialmajzoub profile image
roshdiAlMajzoub •

Now i am getting on the terminal that fcm request for device sent but i am not getting any notificstion

Thread Thread
 
zeeshanmehdi profile image
zeeshan mehdi •

configure receiving end well. there might be issues on receiving end now

Thread Thread
 
roshdialmajzoub profile image
roshdiAlMajzoub •

How can i solve it?

Collapse
 
zeeshanmehdi profile image
zeeshan mehdi •
Collapse
 
codermanuel profile image
Coder-Manuel •

Nice Stuff...

Collapse
 
tamilselvan943 profile image
TAMILSELVAN943 •

Hi i need explain deeply.Can u help me