首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >在flutter应用程序中使用社交登录(Google、Facebook、Apple登录)是否必须使用Firebase

在flutter应用程序中使用社交登录(Google、Facebook、Apple登录)是否必须使用Firebase
EN

Stack Overflow用户
提问于 2020-06-04 11:22:52
回答 1查看 220关注 0票数 0

我正在尝试在flutter应用中实现一个社交登录,我不想使用Firebase,我已经在谷歌和开发论坛上进行了探索,大多数情况下都建议使用firebase。有没有人能帮我解决这个问题呢?如果能推荐一些主要在谷歌、facebook、twitter和苹果的社交登录插件就更好了。

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2020-06-04 11:33:51

简单的回答是否定的。

Flutter并不严格绑定到Firebase,firebase只是其中一个选项。

有一个dart包https://pub.dev/packages/social_login,您可以使用FaceBook account等来实现这些目的。

代码语言:javascript
运行
复制
// Import package
import 'package:social_login/social_login.dart';

// Instantiate it
 final socialLogin = SocialLogin();

//Before calling any methods, set the configuration
socialLogin.setConfig(SocialConfig(
      facebookAppId: FACEBOOK_APP_ID,
      googleWebClientId: GOOGLE_WEB_CLIENT_ID, /*In case a Google tokenId is needed*/
      twitterConsumer: TWITTER_CONSUMER_KEY,
      twitterSecret: TWITTER_CONSUMER_SECRET,
    ));

// Get current logged user
 final FacebookUser facebookUser = await socialLogin.getCurrentFacebookUser();
 final GoogleUser googleUser = await socialLogin.getCurrentGoogleUser();
 final TwitterUser twitterUser = await socialLogin.getCurrentTwitterUser();
票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/62186326

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档