FAQ
Trying to decide on how to implement friend invite functionality.

Right now i have firebase -> zapier -> sendgrid sending the email invite.

Zapier watches /invite/ and deletes the children it finds there when its
done sending.

So inviteFriend() adds a child to /invite/, but i also need to add a
placeholder in the user's friends list. Once the user logs on, i'd like to
replace the placeholder with the invited friend's id.

i'm thinking that inviteFriend() should

1) Add child to /invite/ -- only purpose of /invite/ is a queue of emails
to send to invited users
2) Add child to /tasks/, something like taskId : {
invitedEmail: 'joe@na.com'
inviterUserId: '123' }
3) Add child to /registeredUsers/userId/friends/ with a setPriority as the
invitedEmail.

Then have a job that runs periodically that checks each email in /tasks/ --
if it finds the email in /registeredUsers/ then it should replace
/registeredUsers/inviterUserID/friends/placeholder with the invited user's
actual id.

This is the best i could come up with, surely there is a better way? would
rather not use special urls for the invited user


--
You received this message because you are subscribed to the Google Groups "Firebase + AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email to firebase-angular+unsubscribe@googlegroups.com.
To post to this group, send email to firebase-angular@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/firebase-angular/11a41314-2d29-499f-81d7-742cea95f1e5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Search Discussions

  • Michael Wulf at Jul 22, 2014 at 2:57 pm
    This seems like a decent approach. You could probably bypass the worker
    listening on /registeredUsers by simply having the invitee add themselves
    to the friends index.

    1) Add child to /invited/<invitee's email address>/<inviter's uid> (this
    list should be write-only non-readable; escape . with , in email address)
    2) When new user joins, create profile at /users/<invitee's uid>, include
    email address from auth.email (google or password providers) or record it
    from the invite
    3) have them check /invited/<my email>/ for a user id
    4) write to friends/ list (security rules example
    <https://gist.github.com/katowulf/363e97f454d24ef28be4>)

    Cheers,

    On Sat, Jul 12, 2014 at 5:56 PM, supper's ready wrote:

    Trying to decide on how to implement friend invite functionality.

    Right now i have firebase -> zapier -> sendgrid sending the email invite.

    Zapier watches /invite/ and deletes the children it finds there when its
    done sending.

    So inviteFriend() adds a child to /invite/, but i also need to add a
    placeholder in the user's friends list. Once the user logs on, i'd like to
    replace the placeholder with the invited friend's id.

    i'm thinking that inviteFriend() should

    1) Add child to /invite/ -- only purpose of /invite/ is a queue of emails
    to send to invited users
    2) Add child to /tasks/, something like taskId : {
    invitedEmail: 'joe@na.com'
    inviterUserId: '123' }
    3) Add child to /registeredUsers/userId/friends/ with a setPriority as the
    invitedEmail.

    Then have a job that runs periodically that checks each email in /tasks/
    -- if it finds the email in /registeredUsers/ then it should replace
    /registeredUsers/inviterUserID/friends/placeholder with the invited user's
    actual id.

    This is the best i could come up with, surely there is a better way? would
    rather not use special urls for the invited user


    --
    You received this message because you are subscribed to the Google Groups
    "Firebase + AngularJS" group.
    To unsubscribe from this group and stop receiving emails from it, send an
    email to firebase-angular+unsubscribe@googlegroups.com.
    To post to this group, send email to firebase-angular@googlegroups.com.
    To view this discussion on the web visit
    https://groups.google.com/d/msgid/firebase-angular/11a41314-2d29-499f-81d7-742cea95f1e5%40googlegroups.com
    <https://groups.google.com/d/msgid/firebase-angular/11a41314-2d29-499f-81d7-742cea95f1e5%40googlegroups.com?utm_medium=email&utm_source=footer>
    .
    For more options, visit https://groups.google.com/d/optout.
    --
    You received this message because you are subscribed to the Google Groups "Firebase + AngularJS" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to firebase-angular+unsubscribe@googlegroups.com.
    To post to this group, send email to firebase-angular@googlegroups.com.
    To view this discussion on the web visit https://groups.google.com/d/msgid/firebase-angular/CAFHX4%3DpCJqMpib8RzxaRySMGJ_AMjK8utGQrnwK%3DYXZGr24eCg%40mail.gmail.com.
    For more options, visit https://groups.google.com/d/optout.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupfirebase-angular @
postedJul 13, '14 at 6:10a
activeJul 22, '14 at 2:57p
posts2
users2

2 users in discussion

Supper's ready: 1 post Michael Wulf: 1 post

People

Translate

site design / logo © 2021 Grokbase