Connection from Firebase server to mobile device

187 views
Skip to first unread message

Anil Bairapaka

unread,
Mar 11, 2021, 5:45:50 AM3/11/21
to Firebase Google Group
Hi All,

When Firebase send a notification or In-app message to the andriod device, what protocol it uses? dose it  establishes a TCP connection or Https connection to the mobile device?

Which  SDK function at the mobile device receives the notification or In-app messing? 

Highly appreciate if anyone can help me. 

Thanks & Regards
Anil Bairapaka        

Sam Stern

unread,
Mar 11, 2021, 5:50:07 AM3/11/21
to Firebase Google Group
Hi Anil,

In broad terms:
  • In-App Messaging - there is no notification "sent" to the device at all. The messages are triggered by in-app analytics events and then displayed locally by the In-App messaging SDK.  The SDK uses a standard HTTP request to download the message template if it doesn't already have it cached.
  • FCM - on Android these messages are handled at a system level. The message is received by Google Play services and then forwarded on to your app. So your app won't make a network connection at all to receive the message. I can't comment on the connection details of FCM, I know they use a wide range of techniques to keep a low-power high-availability push notification channel open at all times.
- Sam

--
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/a76496ca-46f6-49b5-a092-908f55b36d01n%40googlegroups.com.

Anil Bairapaka

unread,
Mar 11, 2021, 6:35:43 AM3/11/21
to Firebase Google Group
Dear Sam,

Thanks a lot for your quick response. Can my backend application server send In_app message to the andriod mobile device calling any of the Firebase API's calls, basically i wanted avoid configuration in the Firebase console and send messages via backend application servers( based on some even that take place at my backend server)

Thanks
Anil 

Anil Bairapaka

unread,
Mar 11, 2021, 6:36:06 AM3/11/21
to fireba...@googlegroups.com
Thanks a Lot Sam,for your excellent insights. Now i got it. But i am wondering whether we can invoke a In-App messaging to be triggered by my back end application server, whenever there is some event that happens at the back end i wanted send an In-App message to the device via calling some Firebase API's. Dose FCM provide any API's for sending In-app messages. Basically i do not want to send any In-app messages via my Firebase console. All the In- App messages i wanted sent though API interface( i will write a java code in my back end server that should call  FCM API to pass on the intended In-App message to the andriod devices. If not via API what are the other options i can send an in-app message from my back end application server.   

team, highly appreciate your insights and knowledge sharing.   

Thanks & Regards
Anil        
 


Sam Stern

unread,
Mar 11, 2021, 7:07:03 AM3/11/21
to Firebase Google Group
Hi Anil,

It's important to understand the difference between FCM and FIAM. FIAM messages are only shown as a response to active in-app Analytics events:
https://firebase.google.com/docs/in-app-messaging/explore-use-cases#schedule-messages

You can't trigger a FIAM message from the server except from the console for testing purposes. FCM is the right service to use to send notifications to your user while the app is in the background. These can be triggered from your server using the FCM REST API or one of our server Admin SDKs.

- Sam

Anil Bairapaka

unread,
Mar 11, 2021, 8:51:39 AM3/11/21
to Firebase Google Group
Hi Sam,

So , FIAM is trigger whenever an Analytics events taken place, basically FIAM is created using Firebase console interface. So i can't create any campaign outside firebase console since we can't trigger FIAM from the server. Is this a limitation with server currently or will there be any future enhancement to invoke the FIAM from the server?are there any alternative workarounds? 

Another questions is, though i have seen many Analytics events all are not seen in the in the scheduling section when we  are creating the campaigns in the Engage->In-App messaging. Are these same? both in he analytics and in the scheduling section?

why do we need to create another interface for users via Admin SDK where as there is already an admin interface https://console.cloud.google.com/iam-admin .
I did not understand this from the doc,
"If you are interested in using the Node.js SDK as a client for end-user access (for example, in a Node.js desktop or IoT application), as opposed to admin access from a privileged environment (like a server), you should instead follow the instructions for setting up the client JavaScript SDK."
    
Kindly may i request to give some clarity on this Sam. Thanks a lot in advance. 

Thanks & Regards
Anil

Sam Stern

unread,
Mar 11, 2021, 9:04:22 AM3/11/21
to Firebase Google Group
Hi Anil,

FIAM messages are configured in the Firebase console. They display when the related Analytics event triggers. This is how the product is designed, it's meant for immediate local responses to user actions. If you want to send messages from your server use FCM and then write custom code in your app to receive the FCM message and display some UI.

You can use any Analytics event to trigger FIAM, see the docs here:
https://firebase.google.com/docs/in-app-messaging/compose-campaign#schedule-your-message

There are two types of Firebase SDK:
  • Client SDK - the one you include in your app.
  • Admin SDK - the one you use on your server.
To send messages with FCM from a server you will need to use the Admin SDK. Also please note that FIAM (Firebase In-App Messaging) is not related to IAM (Identity and Access Management) despite the similar acronyms.

- Sam

Anil Bairapaka

unread,
Mar 11, 2021, 9:39:07 AM3/11/21
to Firebase Google Group

Thanks much Sam, its pretty clear now.

by the way when can we expect  FCM & FIAM General availability version getting released any approximate time lines.  It is still in Beta version as per the documentation.  
  
Regards
Anil Bairapaka

Sam Stern

unread,
Mar 11, 2021, 9:40:07 AM3/11/21
to Firebase Google Group
Glad that helped! Sorry I don't have a timeline to share on the GA launch.

- Sam

Anil Bairapaka

unread,
Mar 11, 2021, 11:47:48 AM3/11/21
to Firebase Google Group
it's alright Sam, thanks a lot. 
Regards
Anil 

Reply all
Reply to author
Forward
0 new messages