I am creating a simple chat application in android with Firebase as the backend.
ref3.addValueEventListener(new ValueEventListener() { @Override public void onDataChange(DataSnapshot snapshot) { Map<String, Object> users = (Map<String, Object>) snapshot.getValue(); System.out.println(users.values().toString()); Set s = users.entrySet(); Iterator itr = s.iterator(); while (itr.hasNext()) { Map.Entry m = (Map.Entry) itr.next(); m.getKey(); String myval = m.getValue().toString(); String spmyval[] = myval.split(", "); System.out.println(spmyval[0] + " <-sp0 sp1-> " + spmyval[1]); list=new ArrayList(); a1 = spmyval[0].split("="); Cursor cur = getContentResolver().query( ContactsContract.Contacts.CONTENT_URI, null, null, null, null); if (cur.getCount() > 0) { while (cur.moveToNext()) {
I have a registration page configured in such a way that user contact information is stored in a UID (genrated by firebase). I got shared contacts using the code above. I require the user to send a push message to this total. However, I cannot find a way to recover the UID to which the number belongs. I get a shared number to get a list of friends who use my app. Therefore, I am confused if I need to hard code this or write in the API. Please give me an example if anyone has a solution
source share