Created
July 26, 2020 04:54
-
-
Save sprejjs/63d16794a402a007351ab78bb5d2032d to your computer and use it in GitHub Desktop.
Fetch firebase token
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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