title: BroadcastReceiver is not receiving local broadcast
body: <p>I'm trying to extend the FCM service, and broadcast to the <code>MainActivity</code> upon <code>onNewToken()</code> being called. <code>onNewToken()</code> is indeed called, but the <code>onReceive()</code> method is not. As far as I know, I do not need to define anything else in the manifest, since this is a local broadcast. These are my classes:</p>
  
  <p><em>MainActivity.kt</em></p>
  
  <pre><code>package com.reali.app.mymessagingapp
  
  import android.content.BroadcastReceiver
  import android.content.Context
  import android.content.Intent
  import android.content.IntentFilter
  import android.support.v7.app.AppCompatActivity
  import android.os.Bundle
  import android.support.v4.content.LocalBroadcastManager
  import android.widget.TextView
  import com.google.android.gms.tasks.OnCompleteListener
  import com.reali.app.mymessagingapp.MyFirebaseMessagingService.Companion.TOKEN_REFRESHED_EVENT
  import com.google.firebase.iid.FirebaseInstanceId
  import com.google.firebase.iid.InstanceIdResult
  
  class MainActivity : AppCompatActivity() {
      private lateinit var broadcastReceiver: BroadcastReceiver
      private lateinit var tvTitle: TextView
      private lateinit var tvToken: TextView
  
      override fun onCreate(savedInstanceState: Bundle?) {
          super.onCreate(savedInstanceState)
          setContentView(R.layout.activity_main)
          tvTitle = findViewById(R.id.tvTitle)
          tvToken = findViewById(R.id.tvToken)
  
          broadcastReceiver = object : BroadcastReceiver() {
              override fun onReceive(context: Context, intent: Intent) {
                  tvTitle.text = resources.getString(R.string.token_refreshed)
                  refreshTokenText()
              }
          }
  
          LocalBroadcastManager.getInstance(this).registerReceiver(broadcastReceiver, IntentFilter(TOKEN_REFRESHED_EVENT))
          refreshTokenText()
      }
  
      private fun refreshTokenText() {
          FirebaseInstanceId.getInstance().instanceId.addOnCompleteListener(OnCompleteListener&lt;InstanceIdResult&gt; { task -&gt;
              if (!task.isSuccessful) {
                  return@OnCompleteListener
              }
  
              val token = task.result?.token
              tvToken.text = token
          })
      }
  
  }
  </code></pre>
  
  <p><em>MyFirebaseMessagingService.kt</em></p>
  
  <pre><code>package com.reali.app.mymessagingapp
  
  import android.content.Intent
  import android.util.Log
  import com.google.firebase.messaging.FirebaseMessagingService
  
  class MyFirebaseMessagingService : FirebaseMessagingService()
  {
      companion object {
          const val TOKEN_REFRESHED_EVENT = "token_refreshed_event"
      }
  
      override fun onNewToken(token: String?) {
          Log.d("MyFcmMessagingService", "Refreshed token: " + token!!)
          applicationContext.sendBroadcast(Intent(TOKEN_REFRESHED_EVENT))
      }
  }
  </code></pre>