addIdentity method
Adds Identity for the specified provider.
identity
Identity to be added.
onSuccess
A callback to indicate if this operation was successful.
onConflict
Called if there was a conflict.
onError
Called if operation failed.
Implementation
void addIdentity(Identity identity, Function onSuccess,
Function(ConflictUser) onConflict, Function onError) {
NativeBridge.async('CurrentUser.addIdentity', jsonEncode(identity.toJSON()))
.then((value) {
if (jsonDecode(value)['result'] == '') {
onSuccess();
} else {
onConflict(ConflictUser.fromJSON(jsonDecode(value)));
}
}).catchError(onError);
}