title: I can't receive notifications to my device using FCM
body: <p>First and foremost I read a similar question about this issue, but It didn't solve my issue. This is the question <a href="https://stackoverflow.com/questions/37383684/my-device-doesnt-receive-other-notification-fcm">FCM question</a></p>
  
  <p>I have implemented almost each and everything, but I don't know if I have left something out. I tested the notifications on the API 27 and 28 version devices but it didn't work out. Even the logs aren't displaying in the <code>onMessageReceived()</code>, I checked the <code>google-service.json</code> file and seems okay, so am wondering what is the problem ? </p>
  
  <p><strong>Below is my FirebaseInstance class implementation</strong> </p>
  
  <pre><code>@Override
      public void onMessageReceived(RemoteMessage remoteMessage) {
          super.onMessageReceived(remoteMessage);
  
          Log.d("No messages why ?", "From: " + remoteMessage.getFrom());
  
          // Check if message contains a notification payload.
          if (remoteMessage.getNotification() != null) {
              Log.d("Horray", "Message Notification Body: " + remoteMessage.getNotification().getBody());
          }
  
  
          showNotification(remoteMessage.getNotification().getTitle(),
                  remoteMessage.getNotification().getBody());
      }
  
  
  private void showNotification(String title, String body) {
  
          NotificationManager notificationManager = (NotificationManager)
                  getSystemService(Context.NOTIFICATION_SERVICE);
          String NOTIFICATION_CHANNEL_ID = "huxy.fcm.com.newfcmapp";
  
          if(Build.VERSION.SDK_INT &gt;= Build.VERSION_CODES.O){
  
              NotificationChannel notificationChannel = new NotificationChannel(NOTIFICATION_CHANNEL_ID,
                     "Notification",NotificationManager.IMPORTANCE_DEFAULT );
  
              notificationChannel.setDescription("EDMT Channel");
              notificationChannel.enableLights(true);
              notificationChannel.setLightColor(Color.BLUE);
              notificationChannel.setVibrationPattern(new long[]{0,1000,500,1000});
              notificationChannel.enableLights(true);
              notificationManager.createNotificationChannel(notificationChannel);
          }
  
          NotificationCompat.Builder notificationBuilder =
                  new NotificationCompat.Builder(this,NOTIFICATION_CHANNEL_ID);
  
          notificationBuilder.setAutoCancel(true)
                  .setDefaults(Notification.DEFAULT_ALL)
                  .setWhen(System.currentTimeMillis())
                  .setSmallIcon(R.mipmap.ic_launcher)
                  .setContentTitle(title)
                  .setContentText(body)
                  .setContentInfo("Info");
  
          notificationManager.notify(new Random().nextInt(), notificationBuilder.build());
  
      }
  </code></pre>
  
  <p>The full class can be viewed from the GitHub link here <a href="https://github.com/huxaiphaer/NewFCMApp/blob/master/app/src/main/java/huxy/fcm/com/newfcmapp/MyFirebaseInstanceService.java" rel="nofollow noreferrer">Firebase Messaging instance class</a></p>
  
  <p>Then my <code>Manifest</code> file can also be accessed from here :
  <a href="https://github.com/huxaiphaer/NewFCMApp/blob/master/app/src/main/AndroidManifest.xml" rel="nofollow noreferrer">Manifest file</a></p>
  
  <p>You can also navigate my entire project to see if I have done any error, the project is just testing firebase cloud messaging. There's no other functionality.</p>
  
  <p>Below is the link to the project :</p>
  
  <p><a href="https://github.com/huxaiphaer/NewFCMApp" rel="nofollow noreferrer">FCM sample project</a></p>
  
  <p><strong>This is the console I use to send messages:</strong></p>
  
  <p><a href="https://i.stack.imgur.com/6AYe8.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/6AYe8.png" alt="enter image description here"></a></p>
  
  <p>This is where I placed my <strong>device token</strong> :</p>
  
  <p><a href="https://i.stack.imgur.com/EqD3R.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/EqD3R.png" alt="enter image description here"></a></p>