title: How to generate firebase registration token
body: <p>I am trying to generate firebase registration token with new method but unable to generate this is my code below:</p>
  
  <p><strong>MyFirebaseInstanceIdService.java</strong></p>
  
  <pre><code>public class MyFirebaseInstanceIdService extends FirebaseMessagingService {
  
  @Override
  public void onNewToken(String s) {
      super.onNewToken(s);
  
      FirebaseInstanceId.getInstance().getInstanceId().addOnSuccessListener(new OnSuccessListener&lt;InstanceIdResult&gt;() {
          @Override
          public void onSuccess(InstanceIdResult instanceIdResult) {
  
              String token = instanceIdResult.getToken();
              Log.d("Token",token);
          }
      });
    }
  }
  </code></pre>
  
  <p><strong>Manifest.xml</strong></p>
  
  <pre><code>&lt;manifest xmlns:android="http://schemas.android.com/apk/res/android"
  xmlns:dist="http://schemas.android.com/apk/distribution"
  package="com.app.retrofitapp"&gt;
  
  &lt;dist:module dist:instant="true" /&gt;
  
  &lt;uses-permission android:name="android.permission.INTERNET" /&gt;
  
  &lt;application
      android:allowBackup="true"
      android:icon="@mipmap/ic_launcher"
      android:label="@string/app_name"
      android:roundIcon="@mipmap/ic_launcher_round"
      android:supportsRtl="true"
      android:theme="@style/AppTheme"&gt;
  
      &lt;activity android:name=".Users"&gt;&lt;/activity&gt;
  
      &lt;activity android:name=".MainActivity"&gt;
          &lt;intent-filter&gt;
              &lt;action android:name="android.intent.action.MAIN" /&gt;
  
              &lt;category android:name="android.intent.category.LAUNCHER" /&gt;
          &lt;/intent-filter&gt;
      &lt;/activity&gt;
  
      &lt;service android:name=".MyFirebaseInstanceIdService"&gt;
      &lt;intent-filter&gt;
          &lt;action android:name="com.google.firebase.MESSAGING_EVENT"&gt;&lt;/action&gt;
      &lt;/intent-filter&gt;
      &lt;/service&gt;
  
  &lt;/application&gt;
  </code></pre>
  
  <p>There is no token is showing in log cat with above method.Someone please let me know what I am doing wrong.Any help would be appreciated.</p>
  
  <p><strong>THANKS</strong>  </p>