startLinkingProcess method

  1. @override
Future<void> startLinkingProcess(
  1. LinkEnvironment host,
  2. String sessionKey,
  3. dynamic onSuccess(
    1. String
    ),
  4. dynamic onError(
    1. Exception
    ),
)
override

Implementation

@override
Future<void> startLinkingProcess(LinkEnvironment host, String sessionKey,
    Function(String) onSuccess, Function(Exception) onError) async {
  try {
    final customerId = await methodChannel.invokeMethod(
        'startLinkingProcess', {
      'linkEnvironment': host.toString().split('.').last,
      'sessionKey': sessionKey
    });

    onSuccess(customerId);
  } on PlatformException catch (e) {
    // Handle any platform-specific errors
    onError(e);
  }
}