ios added phone/card switch

This commit is contained in:
Semyon Babushkin
2017-11-23 16:46:40 +03:00
parent 1f6fe22b82
commit 857154faf8
21 changed files with 168 additions and 89 deletions

View File

@@ -82,6 +82,21 @@ getUserByCard(String card, String token) async {
return httpClient.get(finalEndpoint, headers: headers);
}
getUserByPhone(String phone, String token) async {
var headers = {
'DM-Authorization': 'dmapptoken ${await getToken()}',
'Authorization': 'dmtoken ${token}',
'Accept-Language': Intl.defaultLocale
};
var finalEndpoint = "${await getEndpoint()}users/?phone=$phone";
print(finalEndpoint);
return httpClient.get(finalEndpoint, headers: headers);
}
getEndpoint() async {
return await platform.invokeMethod('getEndpoint');
}