Skip to content
Back

How to get users list

  • 0
  • Apple
noam9052
2 Dec, 2023, 15:42

How I can get all the phoneNumbers of my users using appwrite apple sdk?

TL;DR
User wants to know how to get a list of users in their project. They are looking for clarification on creating a functions directory, understanding entrypoint and runtime Node.js. They also want to prevent manipulation of user coins and ensure that the preference field is secure. They have some questions about sending SMS codes and confirming them. They also want to know how to check if a phone session status is verified. Finally, they want to know how to get all the phone numbers of their users using the Appwrite Apple SDK. Solution: To get a list of users, use the users app with an API key. To prevent manipulation of user coins,
Drake
2 Dec, 2023, 15:46

You can't because then any user can get other users phone numbers and that is a privacy concern.

Getting users is only available via the users app with an API key

noam9052
2 Dec, 2023, 17:20

got it, so how i can check if phone session status is verified ?

Drake
2 Dec, 2023, 18:16

For the current user, call account.get(). The response has a phone verification field

noam9052
2 Dec, 2023, 18:34

i got an error :User (role: guests) missing scope (account)

noam9052
2 Dec, 2023, 18:36

get() dont need userId?

noam9052
2 Dec, 2023, 18:44

UserVerfied run after SendCode to the user phone number

Drake
2 Dec, 2023, 18:56

That error means you're not logged in

noam9052
2 Dec, 2023, 19:20

but you can see i created phone Session

Drake
2 Dec, 2023, 21:25

I don't see the sending of the sms code, but I don't see the full code with the confirmation.

Also, it's weird you have the await before the print...will that await the account.get()?

noam9052
5 Dec, 2023, 11:28

i changed it to the user login with the sms session -> after the user put the correct code im using the account.get() to check if his name is empty so i know its a new user - > and then open signup details signupView.... - > after the user field all the signup fields i need to update them so i have question if i use preference field inside appwrite auth for coins and i want this field to be secure so no one can change his amount of coins or someone else coins i can achieve that with preference field and use private functions in my code?

noam9052
5 Dec, 2023, 18:03

??

D5
5 Dec, 2023, 22:29

Instead I recommend having a collection for that. Meanwhile nobody can change other user coins when using user preferences, the current user can change it's own coins

D5
5 Dec, 2023, 22:29

So having a dedicated collection without write and edit permission will help to prevent manipulation (since it will be only possible to modify it with a function)

noam9052
6 Dec, 2023, 07:12

ok so i uploaded the project to a git repo and i connect it to appwrite i tried to figure it out with the documentation but is not understood so i have multiple questions :

i need to make functions directory in my project ? what it is Entrypoint? runtime Node.js?

Thank you for the help 🙂

Ernest
6 Dec, 2023, 08:30

Checkout the official appwrite youtube channel there is a playlist on appwrite functions. Seeing someone do it will help if the documentation is not clear enough for you.

Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more