getToken method

Future<String> getToken(
  1. String sdkId,
  2. String userId,
  3. String key,
  4. int? tokenValidity,
  5. String? token,
)

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);
}