firebase cloud messaging

368 views
Skip to first unread message

Naser Samara

unread,
Jun 14, 2021, 9:09:28 AM6/14/21
to fireba...@googlegroups.com
Hi
i have integrated firebase cloud messaging in my app (ios and android).. it works fine most
of the time.. sometimes notifications are not received especially on iphone devices although i see the sending success on the log(cloud functions).. what could be the reason?

Arthur Thompson

unread,
Jun 29, 2021, 8:15:32 PM6/29/21
to fireba...@googlegroups.com
Hi,

It is likely that the success logs you are referring to are the successful send from FCM to APNs. The delivery of messages to iOS devices is not tracked by FCM. APNs does not guarantee delivery so it is likely that APNs is dropping the message at some point.

--
You received this message because you are subscribed to the Google Groups "Firebase Google Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to firebase-tal...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/firebase-talk/CAN5CugTUL5T4w8g7-vzSqp_Js-gCmWe-B8FWC%3D2mNHCMKJg-qw%40mail.gmail.com.

Naser Samara

unread,
Jul 2, 2021, 11:50:50 PM7/2/21
to Firebase Google Group
can it be something wrong with my code?
actually there are not little amount of Iphone users that do not receive my FCM push notification..
here is a snipped createMessage function.
is there anything wrong with apn property?

 function createMessage(fcmToken:string,request:any){
        const message:fireBase.messaging.Message = {
            token:fcmToken
            ,apns:{
                 fcmOptions:{analyticsLabel:request.body.destination}
                ,payload:{
                    aps:{
                        alert:{
                            title:request.body.titleStr
                            ,body:request.body.bodyStr
                        }
                        ,sound:"default"
                    }
                }
            }
            ,android:{
                notification:{
                    title:request.body.titleStr
                    ,body:request.body.bodyStr
                    ,defaultSound:true
                    ,priority:"max"
                    ,visibility:"public"
                    ,channelId:"myChannelID"
                    ,defaultVibrateTimings:true
                }
                ,data:{
                    title:request.body.titleStr
                    ,body:request.body.bodyStr
                }
                ,priority:"high"
                ,fcmOptions:{analyticsLabel:request.body.destination}

            }
        }

        return message;
    }

Arthur Thompson

unread,
Jul 12, 2021, 12:07:33 PM7/12/21
to Firebase Google Group
Your payload looks fine to me. If your app is receiving notifications at least sometimes it means your send is correct. Please submit a ticket to support where they can look deeper.

Reply all
Reply to author
Forward
0 new messages