Firebase notification from PHP server









up vote
0
down vote

favorite












I am using FCM (Android) and it is working fine from - sending notification directly from compose of firebase console and also when I test my PHP script it gives the correct output:



"multicast_id":5817973274009447959,"success":3,"failure":0,"canonical_ids":0,"results":["message_id":"0:1541837259627974%6102bf30f9fd7ecd","message_id":"0:1541837259627976%6102bf30f9fd7ecd","message_id":"0:1541837259628246%6102bf30f9fd7ecd"]


But when the notification is not getting delivered through the server. Meaning when I push request to firebase through my PHP script it is not delivering the notification despite the correct postman output. Please help!










share|improve this question























  • need more infomation
    – Chanh
    21 hours ago










  • I have setup the firebase with my adroid app correctly. When i send notification from my firebase console it is getting delivered. I wrote all relevant services in android. I store my token via my android activity into my MySQL database along with email. Then I try to get the stored token of my mobile from the mysql via a PHP script and curl operations push it to FCM API URL. When I run the PHP script it is giving the correct output (as listed) but the notification isnt getting delivered. Please let me know if you need more info.
    – Maq
    21 hours ago










  • The php code that fcm sends, and your application is receiving notifications in the background
    – Chanh
    20 hours ago














up vote
0
down vote

favorite












I am using FCM (Android) and it is working fine from - sending notification directly from compose of firebase console and also when I test my PHP script it gives the correct output:



"multicast_id":5817973274009447959,"success":3,"failure":0,"canonical_ids":0,"results":["message_id":"0:1541837259627974%6102bf30f9fd7ecd","message_id":"0:1541837259627976%6102bf30f9fd7ecd","message_id":"0:1541837259628246%6102bf30f9fd7ecd"]


But when the notification is not getting delivered through the server. Meaning when I push request to firebase through my PHP script it is not delivering the notification despite the correct postman output. Please help!










share|improve this question























  • need more infomation
    – Chanh
    21 hours ago










  • I have setup the firebase with my adroid app correctly. When i send notification from my firebase console it is getting delivered. I wrote all relevant services in android. I store my token via my android activity into my MySQL database along with email. Then I try to get the stored token of my mobile from the mysql via a PHP script and curl operations push it to FCM API URL. When I run the PHP script it is giving the correct output (as listed) but the notification isnt getting delivered. Please let me know if you need more info.
    – Maq
    21 hours ago










  • The php code that fcm sends, and your application is receiving notifications in the background
    – Chanh
    20 hours ago












up vote
0
down vote

favorite









up vote
0
down vote

favorite











I am using FCM (Android) and it is working fine from - sending notification directly from compose of firebase console and also when I test my PHP script it gives the correct output:



"multicast_id":5817973274009447959,"success":3,"failure":0,"canonical_ids":0,"results":["message_id":"0:1541837259627974%6102bf30f9fd7ecd","message_id":"0:1541837259627976%6102bf30f9fd7ecd","message_id":"0:1541837259628246%6102bf30f9fd7ecd"]


But when the notification is not getting delivered through the server. Meaning when I push request to firebase through my PHP script it is not delivering the notification despite the correct postman output. Please help!










share|improve this question















I am using FCM (Android) and it is working fine from - sending notification directly from compose of firebase console and also when I test my PHP script it gives the correct output:



"multicast_id":5817973274009447959,"success":3,"failure":0,"canonical_ids":0,"results":["message_id":"0:1541837259627974%6102bf30f9fd7ecd","message_id":"0:1541837259627976%6102bf30f9fd7ecd","message_id":"0:1541837259628246%6102bf30f9fd7ecd"]


But when the notification is not getting delivered through the server. Meaning when I push request to firebase through my PHP script it is not delivering the notification despite the correct postman output. Please help!







php android firebase






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited 21 hours ago









Mostafa Aryannejad

228112




228112










asked 21 hours ago









Maq

32




32











  • need more infomation
    – Chanh
    21 hours ago










  • I have setup the firebase with my adroid app correctly. When i send notification from my firebase console it is getting delivered. I wrote all relevant services in android. I store my token via my android activity into my MySQL database along with email. Then I try to get the stored token of my mobile from the mysql via a PHP script and curl operations push it to FCM API URL. When I run the PHP script it is giving the correct output (as listed) but the notification isnt getting delivered. Please let me know if you need more info.
    – Maq
    21 hours ago










  • The php code that fcm sends, and your application is receiving notifications in the background
    – Chanh
    20 hours ago
















  • need more infomation
    – Chanh
    21 hours ago










  • I have setup the firebase with my adroid app correctly. When i send notification from my firebase console it is getting delivered. I wrote all relevant services in android. I store my token via my android activity into my MySQL database along with email. Then I try to get the stored token of my mobile from the mysql via a PHP script and curl operations push it to FCM API URL. When I run the PHP script it is giving the correct output (as listed) but the notification isnt getting delivered. Please let me know if you need more info.
    – Maq
    21 hours ago










  • The php code that fcm sends, and your application is receiving notifications in the background
    – Chanh
    20 hours ago















need more infomation
– Chanh
21 hours ago




need more infomation
– Chanh
21 hours ago












I have setup the firebase with my adroid app correctly. When i send notification from my firebase console it is getting delivered. I wrote all relevant services in android. I store my token via my android activity into my MySQL database along with email. Then I try to get the stored token of my mobile from the mysql via a PHP script and curl operations push it to FCM API URL. When I run the PHP script it is giving the correct output (as listed) but the notification isnt getting delivered. Please let me know if you need more info.
– Maq
21 hours ago




I have setup the firebase with my adroid app correctly. When i send notification from my firebase console it is getting delivered. I wrote all relevant services in android. I store my token via my android activity into my MySQL database along with email. Then I try to get the stored token of my mobile from the mysql via a PHP script and curl operations push it to FCM API URL. When I run the PHP script it is giving the correct output (as listed) but the notification isnt getting delivered. Please let me know if you need more info.
– Maq
21 hours ago












The php code that fcm sends, and your application is receiving notifications in the background
– Chanh
20 hours ago




The php code that fcm sends, and your application is receiving notifications in the background
– Chanh
20 hours ago

















active

oldest

votes











Your Answer






StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");

StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













 

draft saved


draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53237192%2ffirebase-notification-from-php-server%23new-answer', 'question_page');

);

Post as a guest



































active

oldest

votes













active

oldest

votes









active

oldest

votes






active

oldest

votes















 

draft saved


draft discarded















































 


draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53237192%2ffirebase-notification-from-php-server%23new-answer', 'question_page');

);

Post as a guest














































































這個網誌中的熱門文章

How to read a connectionString WITH PROVIDER in .NET Core?

Node.js Script on GitHub Pages or Amazon S3

Museum of Modern and Contemporary Art of Trento and Rovereto