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

A couple of requests #14

Open
adam-law opened this issue May 4, 2017 · 8 comments
Open

A couple of requests #14

adam-law opened this issue May 4, 2017 · 8 comments

Comments

@adam-law
Copy link

adam-law commented May 4, 2017

Great work on this 👍

Although it's for AS3, you were right when you said that it's easy to adapt to other languages :)

I was wondering if you could provide the processes to sign a user out of firebase, and link accounts as described on this article?

Thanks!

@agentphantom
Copy link
Member

Thank you!

What I normally do to sign out of Firebase is just delete the object/dictionary/map where I store the Firebase Access Token.

In the official SDK it probably does the same since I haven't found a Sign Out method on Google Identity Toolkit.

For the Link/Unlink, I haven't tried those yet. I will give them a shot this weekend and update the guides accordingly.

@adam-law
Copy link
Author

adam-law commented May 4, 2017

Thank you for the quick reply :)

Ah, I figured as much. What I did was to nullify the access token in my application. I'm glad to hear that you take the same approach.

I can't wait to see what you come up with. Even when following the JS guides for web, sometimes the whole process doesn't synergize too well e.g. Google w/ Facebook or vice-versa, but It's likely user-error on my part.

Good luck!

@agentphantom
Copy link
Member

No problem!

Actually, there's a "bug" when logging in with Facebook and Google on the same account. You can take a look at the other issues on this repository for a more detailed reference.

My recommendation is to not enable Google and Facebook on the same project or add a conditional telling the user to log with Google.

@adam-law
Copy link
Author

adam-law commented May 4, 2017

Oh yes, I did read that section when I was trying to figure things out for that issue, and yes, going Google was the answer, though it still causes some "funkiness" on the JS events I hooked up as listeners.

By the way, I'm sorry to ask an unrelated question, but I'm currently using your Firebase Database guide and successfully implemented it on my application.

Under the Adding Data section, my question is, is there a way to specify the key/id for the addition, instead of letting Firebase generate it? This is easily done on the Web API, so I'm wondering if this can also be accomplished via REST. With a user-specified key (e.g. email address), I can perform simple on-key comparisons, as opposed to digging through the entire JSON, to match what I'm looking for.

@agentphantom
Copy link
Member

agentphantom commented May 4, 2017

Yes, you can specify the node name (key) using REST, you only need to modify the url in a PATCH request (POST requests are the ones that autogenerates the key):

From this:

https://<YOUR-PROJECT-ID>.firebaseio.com/journal.json

to this:

https://<YOUR-PROJECT-ID>.firebaseio.com/<your-desired-key-name>.json

A PUT request also works, but I don't recommend those because they delete all values that are not set in the request.

@adam-law
Copy link
Author

adam-law commented May 4, 2017

Agh, I should have said sub-node. But if I read that section and got your example correctly, if I want to affect the sub-node I'd just need to do

https://<YOUR-PROJECT-ID>.firebaseio.com/<node>/<sub-node>.json

yes? I'm trying it out right now, just putting my comment here for others to reference :)

@agentphantom
Copy link
Member

agentphantom commented May 4, 2017

Yes, exactly!

As an additional note, if you go deeper:

https://<YOUR-PROJECT-ID>.firebaseio.com/<node>/<sub-node>/<another-node>/<another-subnode2>.json

All those sub nodes will be created automatically when you PATCH something to another-subnode2.

@adam-law
Copy link
Author

adam-law commented May 4, 2017

Awesome! Thanks for the tip! :)

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