createExchangeDataRecoveryInfo method

Future<RecoveryDataKey> createExchangeDataRecoveryInfo(
  1. String sdkId,
  2. String delegateId,
  3. int? lifetimeSeconds,
  4. RecoveryKeyOptions? recoveryKeyOptions,
)

Implementation

Future<RecoveryDataKey> createExchangeDataRecoveryInfo(String sdkId, String delegateId, int? lifetimeSeconds, RecoveryKeyOptions? recoveryKeyOptions) async {
	final res = await _methodChannel.invokeMethod<String>(
		'RecoveryApi.createExchangeDataRecoveryInfo',
		{
			"sdkId": sdkId,
			"delegateId": jsonEncode(delegateId),
			"lifetimeSeconds": jsonEncode(lifetimeSeconds),
			"recoveryKeyOptions": jsonEncode(recoveryKeyOptions == null ? null : RecoveryKeyOptions.encode(recoveryKeyOptions!)),
		}
	).catchError(convertPlatformException);
	if (res == null) throw AssertionError("received null result from platform method createExchangeDataRecoveryInfo");
	final parsedResJson = jsonDecode(res);
	return RecoveryDataKey.fromJSON(parsedResJson);
}