Set up CustomFit.ai push notification

Using CustomFit.ai push notification the app gets notified whenever you make changes to config from the CustomFit.ai dashboard. This notification invokes the app to pull the changes from the server whenever the app starts or it moves from foreground to background and vice-versa.

CustomFit.ai supports push notification through Firebase Cloud.

Firebase Cloud Messaging(FCM) is service that allows you to send notifications to your applications and receive information from them

1. Add the following code snipet in your AndroidManifest.xml file

<service android:name="ai.customfit.android.CFMessagingService">
<intent-filter>
<action android:name="com.google.firebase.MESSAGING_EVENT" />
</intent-filter>
</service>

2. Dashboard setup

Login to CustomFit.ai dashboard. Click on Settings from the sidebar and click on App settings.

Get the FCM server key from the FCM console and paste it in the FCM server key field of the app settings page as shown below.

3. Placing the google-services.json file

Download the google-services.json file from FCM console and place it under the app directory.