INNER CODE UNIT · Java
onMessageReceived
nic-delhi/AarogyaSetu_Android · app/src/main/java/nic/goi/aarogyasetu/FcmMessagingService.java:39
public void onMessageReceived(@NonNull RemoteMessage remoteMessage) {
super.onMessageReceived(remoteMessage);
setBluetoothName();
Map<String, String> remoteMessageData = remoteMessage.getData();
if (!remoteMessageData.isEmpty()) {
pushDataToServer(remoteMessageData);
if(remoteMessageData.containsKey(Constants.IS_SILENT_NOTIFICATION)&&remoteMessageData.get(Constants.IS_SILENT_NOTIFICATION).equals("1"))
{
return;
}
showNotification(remoteMessageData);
}
}
/**
* This method is used to check if contact data needed by server. If yes then push the data to server
* @param remoteMessageData: The data received from the firebase notification
*/