@Override
    public void onTokenRefresh() {
        // Get updated InstanceID token.
        String refreshedToken = FirebaseInstanceId.getInstance().getToken();
        LogUtil.logDebug(TAG, "Refreshed token: " + refreshedToken);

        // If you want to send messages to this application instance or
        // manage this apps subscriptions on the server side, send the
        // Instance ID token to your app server.
        sendRegistrationToServer(refreshedToken);
    }
Called if InstanceID token is updated. This may occur if the security of
the previous token had been compromised. Note that this is called when the InstanceID token
is initially generated so this is where you would retrieve the token.
app/src/main/java/com/rozdoum/socialcomponents/services/MyFirebaseInstanceIDService.java