getUserClaims method
get user's claims data Throws UsersServiceException if failed Returns Map<String, dynamic> if successful
Implementation
Future<Map<String, dynamic>> getUserClaims(String userId) async {
try {
final callable = _functions.httpsCallable('callables-getUserClaims');
final result = await callable.call({'uid': userId});
final claims = result.data as Map<String, dynamic>;
return claims;
} on FirebaseFunctionsException catch (e) {
// Handling FirebaseFunctionsException
throw UserDataServiceException.fromRdevException(e.toRdevException());
} on Exception catch (e) {
// Handling other exceptions
throw UserDataServiceException(message: e.toString());
}
}