New Firebase token is generated (onTokenRefresh()
is called) when The app is run first time. I want to print token when users close the application alltime.(Example; open app and close it- token print, 2. time open and close - token print, 3. time and again.) So I want to print token when every closing. Sorry for my bad English.
public class MyFirebaseInstanceIDService extends FirebaseInstanceIdService {
@Override
public void onTokenRefresh() {
String token = FirebaseInstanceId.getInstance().getToken();
registerToken(token);
Log.d("TOKEN Verildi", token);
}
private void registerToken(String token){
//print code here
}}
Edit: I have added
String token = FirebaseInstanceId.getInstance().getToken();
registerToken(token);
this code in main activity onCreate and after this code
private void registerToken(String token){
//print code here
}}
genereted signed apk successfully but apk not open in my phone. It say Unfortunately (app name) has stopped.