geweald / flutter_onfido

Flutter Onfido Plugin
MIT License
8 stars 20 forks source link

PlatformException: Error serializing response #7

Closed SanchezQb closed 3 years ago

SanchezQb commented 3 years ago

Hi, I'm getting a platform exception while trying to get a result from submitting verification for captureFace only. If I pass in both captureFace and captureDocument, it works just fine PlatformException(error, Error serializing response, null, null)

Here is the code:

Future<void> startOnfido({required String sdkToken}) async {
    try {
      OnfidoResult result = await FlutterOnfido.start(
        config: OnfidoConfig(
          sdkToken: sdkToken, // PROVIDE TOKEN YOU'VE GOT FROM YOUR BACKEND
          flowSteps: OnfidoFlowSteps(
            welcome: true,
            // captureDocument: OnfidoCaptureDocumentStep(
            //   countryCode: OnfidoCountryCode.NGA,
            //   docType: OnfidoDocumentType.NATIONAL_IDENTITY_CARD,
            // ),
            captureDocument: null,
            captureFace: OnfidoCaptureFaceStep(
              OnfidoCaptureType.PHOTO,
            ),
          ),
        ),
        iosAppearance: OnfidoIOSAppearance(
          onfidoPrimaryColor: "#3A3391",
        ),
      );
      print(
          "=====================================================================");
      print(
          "=====================================================================");
      print(
          "=====================================================================");
      print(result.face);
      // ASK YOUR BACKEND IF USER HAS PASSED VERIFICATION
    } on OnfidoConfigValidationException catch (e) {
      print(e.message);
    } on PlatformException catch (e) {
      print(
          "=====================================================================");
      print(
          "=====================================================================");
      print(e);
    }
  }
geweald commented 3 years ago

@SanchezQb thanks for the report, should be fixed in 0.2.1, reopen this issue if needed