​Hi all,

Following is the architecture of FCM implementation of Android agent of
IoT/EMM. Firebase cloud messaging(FCM) is a push notification mechanism
introduced by Google for app developers to send notifications to devices.
Prior to FCM, EMM used Google cloud messaging(GCM) which was the earlier
standard for sending notifications to devices.
Coming from GCM to FCM, major changes in architecture are in the Agent side
implementation compared to server side implementation of EMM. In case of
EMM, only a wake up call is sent to a device asking the device to contact
the EMM server to fetch new pending operation. Following is a simple
illustration of how the mechanism works with FCM.



-- 


*Prerequisites*
Using firebase console, a new project needs to be created which will
provide the user with Google-services.json file and a firebase cloud
messaging token. Google-services.json contains authentication details
required  to communicate with the Google FCM server. This file needs to be
added to Android agent source code's root folder as defined by Google and
will be later be used to communicate with FCM server. Firebase cloud
messaging token has to be available to IOT/EMM server and this token acts
as the API key when sending messages to FCM server.

*Things that happen one time*
1. Registration details sending

When the agent starts up for the very first time, since the FCM related
services are implemented in the agent and the Google-services.json is
available, FCM services begin an automatic registration process with the
FCM server. This call is hidden from the developers to avoid the earlier
GCM complexities of handling the registration with the GCM server manually.
Device will send the necessery details to FCM server extracted from
Google-services.json to register it-self with the FCM server.

2. FCM instance ID token

FCM server will keep a record of the device and issue a token for the
device, which will be returned and will be automatically persisted by the
FCM libraries in the Agent.

3. Send FCM instance ID token to EMM/IoT server

Agent will retrieve the persisted token and send it to EMM/IoT server, so
that it can send commands to FCM referring the instance ID token of the
device.

Now the server has all the details that are necessery to send a message to
the device.

*Sending a wake up call to device*
4. Whenever a new operation is added against a specific device, IoT/EMM
server will send a wake up call to FCM server with the Firebase cloud
messaging token and FCM instance ID token. Firebase cloud messaging token
will show that the IoT/EMM server has permission to use FCM services and
FCM instance ID token specifies to which device the wake up must be sent.
5. FCM server send the wake up call to the device and the Android agent
listens to incoming FCM messages.
6. At this point FCM communication is over and as a response to the wake
up, the Agent will poll the IoT/EMM server to fetch any pending operations
such as ring and will execute it.

Regards,
Inosh

Inosh Perera
Senior Software Engineer, WSO2 Inc.
Tel: 077813 7285, 0785293686
_______________________________________________
Architecture mailing list
[email protected]
https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture

Reply via email to