I have a Future which is called when user trys to login:
Future<String> login(String phone, String password) async {
_firebaseMessaging.subscribeToTopic('all');
_firebaseMessaging.getToken().then((fmctoken) => print(fmctoken));
Response response = await _dio.post(loginUrl, data: {
"login": phone,
"password": password,
});
return response.data["objectId"];
}
In this Future i also get the fmc_device_token, which I want to upload to other rest_api_url. The problem is, that i need this: return response.data["objectId"];
the objectId to upload the data.
How can I make, that if this Future is called and the objectId received, the value of the fmctoken_device will upload (post) on other url.
Thanks for your help!!!