setUserToServer static method
Implementation
static setUserToServer(BuildContext context) async {
try {
Dio().get("http://ip-api.com/json").then((countryData) async {
await Dio().post(baseUrl + addUser, data: {
"phoneId": PackageInfoX().phoneId,
"appPackage": PackageInfoX().packageName,
"country": json.decode(json.encode(countryData.data))['country'],
"networkData": json.encode(countryData.data),
"deviceData": json.encode(PackageInfoX().deviceData),
});
await setOneSignalId();
await setAppTrans();
});
} on DioError catch (error) {
dog.e(error.response!.statusMessage,
title: "Error User Authentication", tag: "UserAuth");
} catch (err) {
dog.i(err.toString(),
title: "Error User Authentication", tag: "UserAuth");
}
}