title: How to get (FCM) token in android studio?
body: <p>It's my first time to use FCM, I created a new project in android studio, then I clicked on "tools" and I chose Firebase, <a href="https://i.stack.imgur.com/Nm3v9.png" rel="nofollow noreferrer">I followed all the steps in this window</a></p>
  
  <p><a href="https://i.stack.imgur.com/drM8j.png" rel="nofollow noreferrer">and I copied and pasted these blocks of code exactly in the same location as mentioned</a></p>
  
  <p>here's my Java code</p>
  
  <pre><code>public class ZeftToken extends FirebaseInstanceIdService {
  
  @Override
  public void onTokenRefresh() {
      // Get updated InstanceID token.
      String refreshedToken = FirebaseInstanceId.getInstance().getToken();
      Log.d("zeft", "Refreshed token: " + refreshedToken);
  
  }
  }
  
  public class MainActivity extends AppCompatActivity {
  
  @Override
  protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.activity_main);
  
  }
  }
  </code></pre>
  
  <p>This is my Manifest file:</p>
  
  <pre><code>&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=".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=".ZeftToken"&gt;
          &lt;intent-filter&gt;
              &lt;action android:name="com.google.firebase.INSTANCE_ID_EVENT"/&gt;
          &lt;/intent-filter&gt;
      &lt;/service&gt;
  &lt;/application&gt;
  </code></pre>
  
  <p>When I run the application I don't get the token in the logcat and it's completely missing. I don't know what's wrong.</p>