BaseAuthQuery<T>.usingSocial constructor
This constructor uses for creating query for sign in user via social networks or other providers.
Different providers contains different count of parameters for authorisation and we can set they
to parameter args
.
_provider
Name of provider. All possible values can be found CubeProvider
args
Parameters needed to authorisation.
CubeProvider.FACEBOOK
args0
- Access Token;
CubeProvider.TWITTER
args0
- Access Token;
args1
- Access Token Secret;
CubeProvider.FIREBASE_PHONE
args0
- ID of project in Firebase Console;
args1
- Access Token;
CubeProvider.FIREBASE_EMAIL
args0
- ID of project in Firebase Console;
args1
- Access Token;
Please describe parameters for new Provider here.
Implementation
BaseAuthQuery.usingSocial(this._provider, List<String?> args) {
if (_provider == CubeProvider.FACEBOOK ||
_provider == CubeProvider.TWITTER) {
this._accessToken = args[0];
this._accessTokenSecret = args[1];
} else if (_provider == CubeProvider.FIREBASE_PHONE ||
_provider == CubeProvider.FIREBASE_EMAIL) {
this._projectId = args[0];
this._accessToken = args[1];
}
}