getToken method
Implementation
Future<String> getToken(String sdkId, String userId, String key, int? tokenValidity, String? token) async {
final res = await _methodChannel.invokeMethod<String>(
'UserApi.getToken',
{
"sdkId": sdkId,
"userId": jsonEncode(userId),
"key": jsonEncode(key),
"tokenValidity": jsonEncode(tokenValidity),
"token": jsonEncode(token),
}
);
if (res == null) throw AssertionError("received null result from platform method getToken");
final parsedResJson = jsonDecode(res);
return (parsedResJson as String);
}