firebase android studio для отправки push notification

  android, java, push-notification

the application must call the user to the cabinet at the click of a button
here is the source code itself push works but for one user

    holder.call.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {

            FirebaseDatabase.getInstance().getReference().child("Tokens").child(user.getUid().toString().trim()).child("token").addListenerForSingleValueEvent(new ValueEventListener() {
                @Override
                public void onDataChange(@NonNull DataSnapshot dataSnapshot) {
                    String usertoken=dataSnapshot.getValue(String.class);
                    sendNotifications(usertoken, user.getName().toString().trim(),Message.getText().toString().trim());
                }

                @Override
                public void onCancelled(@NonNull DatabaseError databaseError) {

                }
            });
        }
    });

Source: Android Questions

LEAVE A COMMENT