Search
 
SCRIPT & CODE EXAMPLE
 

JAVA

get device token firebase

//This is the only one worked for me as of August 29, 2021
FirebaseMessaging.getInstance().getToken().addOnSuccessListener(token -> {
        if (!TextUtils.isEmpty(token)) {
            Log.d(TAG, "token successfully retrieved : " + token);
        } else{
            Log.w(TAG, "token should not be null...");
        }
    }).addOnFailureListener(e -> {
        //handle e
    }).addOnCanceledListener(() -> {
        //handle cancel
    }).addOnCompleteListener(task -> Log.v(TAG, "This is the token : " + task.getResult()));
Comment

PREVIOUS NEXT
Code Example
Java :: current time in long java 
Java :: how to check if notification is showing in android 
Java :: how to take max value from priority queue in java 
Java :: generating random number 
Java :: android iinput edit text password icon change 
Java :: how to change checkbox color in android 
Java :: java swing menu click event 
Java :: java generate random integer in range 
Java :: hello world program in java 
Java :: nested list java 
Java :: java add elements array 
Java :: java iterate hashmap 
Java :: override onbackpressed in fragment 
Java :: Android Bitmap to Base64 String 
Java :: spring boot access images in resources folder 
Java :: java what is at 
Java :: delete one item from list recycleview 
Java :: how to add string to array in java 
Java :: how to split string in java android 
Java :: mono command to compile C# library code 
Java :: cors spring 
Java :: min in java 
Java :: richest customer wealth 
Java :: socket in java 
Java :: java arraylist add 
Java :: sort a list with custom comparator java 
Java :: check if user has internet connection in kotlin 
Java :: setting java home 
Java :: how to get input of local date type java 
Java :: destory fragment 
ADD CONTENT
Topic
Content
Source link
Name
3+4 =