Skip to content

Instantly share code, notes, and snippets.

@sprejjs
Created July 26, 2020 04:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sprejjs/63d16794a402a007351ab78bb5d2032d to your computer and use it in GitHub Desktop.
Save sprejjs/63d16794a402a007351ab78bb5d2032d to your computer and use it in GitHub Desktop.
Fetch firebase token
FirebaseInstanceId.getInstance().instanceId
.addOnCompleteListener(OnCompleteListener { task ->
if (!task.isSuccessful) {
return@OnCompleteListener
}
val token = task.result?.token
Toast.makeText(baseContext, token, Toast.LENGTH_SHORT).show()
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment