Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Request] Accept, Reject friend-requests? #2

Closed
summers314 opened this issue Dec 18, 2016 · 2 comments
Closed

[Request] Accept, Reject friend-requests? #2

summers314 opened this issue Dec 18, 2016 · 2 comments

Comments

@summers314
Copy link

summers314 commented Dec 18, 2016

Hey. Extremely helpful library.

Does the library support friend requests and the necessary checks required when I'm sending a friend request? Like:
-Check if username is valid
-Check if users are not already friends etc.

Or any plans of building that in the future?

http://stackoverflow.com/questions/41198113/sending-friend-request-using-firebase-on-android

Thanks :)

@amaboura
Copy link
Owner

Hey there,

Using the current schema, you still can check if the username is valid, if you encrypt a username using a basic hash function (eg: sha224), then you can use it as key for each user child added to the users node, which means using the same hash function later, you will be able to verify the username availability.

To check if the user is already a friend connection, you just need to check if both users follow each others.

Friend request feature is interesting to add, however you can still achieve this, by creating a custom event each time a user send a request, which you can tag by, for example, "request_sent", and then do the same thing on the receiver side, and tag it with "request_received", you subscribe on firebase nodes updates on both sender and receiver sides, which then you can handle through the client app (eg: accept friend request / notify the sender)

I hope this helps.

Thanks

@summers314
Copy link
Author

Cool. Ill check it out. Thanks :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants