Okay so, I updated the firebase dependencies, linking it to my account, but for some weird reason,
whenever I'm testing out the app, I keep getting this Argument Error. To debug it, i also tried printing out the 'name' but with no luck. It keeps returning 'No Such Document'.
`void discovery() async {
try {
bool a = await Nearby().startDiscovery(loggedInUser.email, strategy,
onEndpointFound: (id, name, serviceId) async {
print('I saw id:$id with name:$name'); // the name here is an email
var docRef =
_firestore.collection('users').document(loggedInUser.email);
// When I discover someone I will see their email and add that email to the database of my contacts
// also get the current time & location and add it to the database
docRef.collection('met_with').document(name).setData({
'username': await getUsernameOfEmail(email: name),
'contact time': DateTime.now(),
'contact location': location.getLocation(),
});
}, onEndpointLost: (id) {
print(id);
});
print('DISCOVERING: ${a.toString()}');
} catch (e) {
print(e);
}
Okay so, I updated the firebase dependencies, linking it to my account, but for some weird reason, whenever I'm testing out the app, I keep getting this Argument Error. To debug it, i also tried printing out the 'name' but with no luck. It keeps returning 'No Such Document'.
`void discovery() async { try { bool a = await Nearby().startDiscovery(loggedInUser.email, strategy, onEndpointFound: (id, name, serviceId) async { print('I saw id:$id with name:$name'); // the name here is an email
}`