generate registration token at client side firebase code example
Example: firebase registration token
FirebaseInstanceId.getInstance().getInstanceId().addOnSuccessListener(new OnSuccessListener() {
@Override
public void onSuccess(InstanceIdResult instanceIdResult) {
String token = instanceIdResult.getToken();
// send it to server
}
});