我正在尝试在flutter应用中实现一个社交登录,我不想使用Firebase,我已经在谷歌和开发论坛上进行了探索,大多数情况下都建议使用firebase。有没有人能帮我解决这个问题呢?如果能推荐一些主要在谷歌、facebook、twitter和苹果的社交登录插件就更好了。
发布于 2020-06-04 11:33:51
简单的回答是否定的。
Flutter并不严格绑定到Firebase,firebase只是其中一个选项。
有一个dart包https://pub.dev/packages/social_login,您可以使用FaceBook account等来实现这些目的。
// 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();https://stackoverflow.com/questions/62186326
复制相似问题