curl sent Firebase Cloud Messaging alert not visibly appearing on iOS device

224 views
Skip to first unread message

alex

unread,
Jun 28, 2016, 2:20:39 PM6/28/16
to Firebase Google Group

I am trying to get Firebase Cloud Messaging iOS alerts sent from my server to FCM to appear on my iOS device.

If I send the message from the FCM console:

https://console.firebase.google.com/project/your-awesome-project/notification

and the FCM sample app:

https://github.com/firebase/quickstart-ios

is closed or in the background, the alerts show up beautifully, 

and if it's in the foreground I see this in the iOS console:

{
    aps =     {
        alert = "HEY YO";
    };
    "gcm.message_id" = "0:123456789_blah_blah";
    "gcm.n.e" = 1;
    "google.c.a.c_id" = 123XXXXXXXX789;
    "google.c.a.e" = 1;
    "google.c.a.ts" = 123XXX789;
    "google.c.a.udt" = 0;
}

...but if I try this:

curl -X POST 
--header "Authorization: key=<server key>" 
--Header "Content-Type: application/json" 
https://fcm.googleapis.com/fcm/send
-d "{\"to\":\"<device registration id>\",\"notification\":{\"body\": \"HEY YO\"}}"

...it never shows up as an alert, no matter if the FCM sample app is in the foreground, background, or completely closed.

It does however show up in the iOS console but with fewer parameters:

{
    aps =     {
        alert = "HEY YO";
    };
    "gcm.message_id" = "0:123456789_blah_blah";
}

Is it possible to use curl to fire off Firebase Cloud Messaging notifications that appear as alerts on my iOS device?

Thank you!  :-)

http://stackoverflow.com/questions/38065813/curl-sent-firebase-cloud-messaging-alert-not-visibly-appearing-on-ios-device


Reply all
Reply to author
Forward
0 new messages