title: Why not getting Android Firebase FCM registration token?
body: <p>I'm trying to send a push notification to my app from my app server but i'm not getting the FCM registration token through <code>FirebaseInstanceIdService</code>. Here i'm using Genymotion personal edition emulator.is that problem with my emulators API?</p>
  
  <p>here is FirebaseInstanceIdService</p>
  
  <pre><code>public class FcmInstanceIdService extends FirebaseInstanceIdService {
  
  @Override
  public void onTokenRefresh() {
      String recent_token = FirebaseInstanceId.getInstance().getToken();
  
      SharedPreferences sharedPreferences = getApplicationContext().getSharedPreferences(getString(R.string.FCM_PREF), Context.MODE_PRIVATE);
      SharedPreferences.Editor editor = sharedPreferences.edit();
      editor.putString(getString(R.string.FCM_TOKEN),recent_token);
      editor.commit();
  }
  </code></pre>
  
  <p>}
   here is MainActivity</p>
  
  <pre><code>public class MainActivity extends AppCompatActivity {
  
  String url = "http://myurl.fcm_insert.php";
  @Override
  protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.activity_main);
  
      Button bt = (Button) findViewById(R.id.button2);
  
      bt.setOnClickListener(new View.OnClickListener() {
          @Override
          public void onClick(View view) {
              SharedPreferences sharedPreferences = getApplicationContext().getSharedPreferences(getString(R.string.FCM_PREF), Context.MODE_PRIVATE);
              final String token = sharedPreferences.getString(getString(R.string.FCM_TOKEN),"");
  
              StringRequest stringRequest = new StringRequest(Request.Method.POST, url, new Response.Listener&lt;String&gt;() {
                  @Override
                  public void onResponse(String response) {
  
                      Toast.makeText(MainActivity.this,"Success",Toast.LENGTH_SHORT).show();
                  }
              }, new Response.ErrorListener() {
                  @Override
                  public void onErrorResponse(VolleyError error) {
                      Log.d("Response",error.toString());
                      Toast.makeText(MainActivity.this,error.toString(),Toast.LENGTH_SHORT).show();
                  }
              })
              {
                  @Override
                  protected Map&lt;String, String&gt; getParams() throws AuthFailureError {
                      Map&lt;String,String&gt; params = new HashMap&lt;String, String&gt;();
                      params.put("token",token);
                      return params;
                  }
              } ;
              Singletone.getSingletone(MainActivity.this).addToRequest(stringRequest);
          }
      });
  }
  }
  </code></pre>
  
  <p>it's only sending the default value to the server.</p>