Configuring WSO2 EMM with Firebase Cloud Messaging
Prerequisites
 Clone theÂ
product-emm
 GIT repository. This will be referred to asÂ<EMM_SOURCE_HOME>
.git clone https://github.com/wso2/product-emm.git
- Download and install Android Studio. For more information, see installing Android Studio.
Follow the instructions given below to configure WSO2 EMM Firebase Cloud Messaging (FCM):
- Go to the Firebase API Console.
- Click CREATE NEW PROJECT.
Provide a preferred name for the project (example: EMM-FCM), select the country/region, and click CREATE PROJECT.
The new project will be created in few seconds, and you will be navigated to the overview page of the project.Click Add Firebase to your Android App on the overview page of the project.
-
Provide the package name of the EMM Android agent, that isÂ
org.wso2.emm.agent
and click ADD APP.
The generated
google-service.json
file will download. - Click CONTINUE >Â FINISH to finish the process and create the application.Â
You will then be navigated to the overview of the created application.
- Click the menu icon of the project you created and click Manage.
- Go to the CLOUD MESSAGING tab and note down the Firebase Cloud messaging token. You need to provide this token as the server key when configuring the Android platform.
Replace the
<EMM_SOURCE_HOME>/modules/mobile-agents/android/client/client/google-service.json
file with thegoogle-service.json
file that downloaded in the fifth step.Open
<EMM_SOURCE_HOME>
via Android Studio and build the project.The WSO2 Android agent can't be built via the usual Android developer SDK, as it requires access to developer restricted APIs. Therefore, you need to replace the existingÂ
android.jar
 file that is in theÂ<SDK_LOCATION>/platforms/android-<COMPILE_SDK_VERSION>
 directory with the explicitly builtÂandroid.jar
 file that has access to the restricted APIs.Â
For more information on how to build the project, see creating a new APK file.- Rename the createdÂ
.apk
 file toÂandroid-agent.apk
. - Copy the renamed file and replace it instead of the existingÂ
android-agent.apk
 file that is in the <EMM_HOME>/repository/deployment/server/jaggeryapps/emm-web-agent/units/asset-download-agent-android/public/asset
 directory.
Now you can configure WSO2 EMM with Android and register Android devices.