ICode9

精准搜索请尝试: 精确搜索
首页 > 其他分享> 文章详细

Flutter Android, iOS login with Google, Facebook account using Firebase

2022-01-26 20:03:05  阅读:417  来源: 互联网

标签:account Google some app iOS will facebook Facebook login


I spent some time working on this.

 

Here I will just address some errors when I met.

It's pretty easy to embed Google login with Firebase. The most problematic thing is Facebook login.

 

Firstly you will need a facebook account, developer account.

Then go here: https://developers.facebook.com/docs/facebook-login/android

create an app, be alerted! In year 2022, you need to create an app for consumers only. 

if you create an app on facebook for commercial, facebook needs you to provide passport, id and some license, it will takes many days before you can develop anything.

 

Then you will have a  "app id", "facebook access token". 

Just follow the link above to do it. The main problem you will meet is that you can't make your facebook app live.

You need to provide ToC and Policy and other User Data Deletation URL.

Go here to generate some templates: https://www.termsfeed.com/blog/privacy-policy-url-facebook-app/#

Also, you will need to register the app with Firebase. In put the app id, app secret, and copy the callback URL from firebase. Paste the callback URL to the facebook's app.

 

If you have some problems like this:  

Solved HttpStatus 400, errorCode 100, subErrorCode 33, errorType GraphMethodException | FaceBook Aut

  

Go watch this video:

https://www.youtube.com/watch?v=2Q30HK0wJos

 

 

 

Be sure to make your app live like this, after you input all the things Facebook wants you do.

 

Don't forget to grant permissions to your app. It controls what kinda info you can get from users on Facebook.

 

I used 2 kinds of Facebook login methods with Flutter. Both works well.

This one "flutter_login_facebook" is lite and cool: https://pub.dev/packages/flutter_login_facebook#android

This one "flutter_facebook_auth" is big and full: https://pub.dev/packages/flutter_facebook_auth

They all work very well, but I prefer flutter_facebook_auth. Coz its doc is very informative. It tells you if you have Android 11 or up, you will need to add something in AndroidManualfest.xml

 

Let's see the login page.

This is pretty cool. After successfully logined in. You can see users in Firebase's dashboard.

 

There's another sad error i got. It's the chrome in my Android 11 simulator crashed everytime. So i have to install another browser "Chrome beta", and set it to be default.

When you login via Facebook like this, a browser will called. Then it works. 

Ironically "chrome beta" is more reliable than chrome on Android for this scenario.

Anyway, it works. Oh yeah!

 

标签:account,Google,some,app,iOS,will,facebook,Facebook,login
来源: https://www.cnblogs.com/spaceship9/p/15847993.html

本站声明: 1. iCode9 技术分享网(下文简称本站)提供的所有内容,仅供技术学习、探讨和分享;
2. 关于本站的所有留言、评论、转载及引用,纯属内容发起人的个人观点,与本站观点和立场无关;
3. 关于本站的所有言论和文字,纯属内容发起人的个人观点,与本站观点和立场无关;
4. 本站文章均是网友提供,不完全保证技术分享内容的完整性、准确性、时效性、风险性和版权归属;如您发现该文章侵犯了您的权益,可联系我们第一时间进行删除;
5. 本站为非盈利性的个人网站,所有内容不会用来进行牟利,也不会利用任何形式的广告来间接获益,纯粹是为了广大技术爱好者提供技术内容和技术思想的分享性交流网站。

专注分享技术,共同学习,共同进步。侵权联系[81616952@qq.com]

Copyright (C)ICode9.com, All Rights Reserved.

ICode9版权所有