Push Notifications - Android

How to configure Push notifications for Android SDK in Zoho SalesIQ?

​You can send push notifications when the user is not using the android app. In the Zoho SalesIQ console, navigate to Settings > Brands > Installation > Android, scroll down to the Configure push notifications section and enable the toggle button.

How to register my Mobile Device?

Step 1: Get the FCM key from the Google services. A server key that authorizes your app server for access to Google services, including sending messages via Firebase Cloud Messaging. Follow the steps here to set up FCM service. 

Before you proceed with the below steps, check the listed requirements:

  • Created a project in the https://console.firebase.google.com/
  • Added your app to the created firebase project
  • Override the FirebaseMessagingService class onMessageReceived() method and onNewToken() method.

Step 2: Click the Settings icon in the Firebase console, and navigate to Project Settings > Cloud Messaging, you can find the server key.

Step 3: Enter the server key in the input box.

AndroidManifest.xml

Copied <manifest xmlns:android="http://schemas.android.com/apk/res/android">
   <application
        android:icon="@mipmap/ic_launcher">
        
       ...
        < service
           android:name=".MyFirebaseMessagingService"
           android:exported="false">
           <intent-filter>
               <action android:name="com.google.firebase.MESSAGING_EVENT" />
           </intent-filter>
       </service>
    </application>
</manifest>

MyFirebaseMessagingService.java

Copied public class MyFirebaseMessagingService extends FirebaseMessagingService {
    @Override
    public void onMessageReceived(RemoteMessage remoteMessage) {
        Map extras = remoteMessage.getData();
        MobilistenPlugin.handleNotification(this.getApplication(), extras);
    }

    @Override
    public void onNewToken(String token) {
        String refreshedToken = FirebaseInstanceId.getInstance().getToken();
        MobilistenPlugin.enablePush(refreshedToken, true / false);
    }
}

Step 5: Run your app with the code given in step 4

Step 6: To experiment with the push notification message services, you can initiate a test message to the registered mobile device here.