> For the complete documentation index, see [llms.txt](https://docs.uqudo.com/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.uqudo.com/docs/kyc/uqudo-sdk/integration/flutter/nfc-reading-flow.md).

# NFC / Reading Flow

The "NFC/Reading Flow" is essentially the same as the "Enrollment Flow," with the only difference being the initial step. Instead of automatically scanning a document using the phone's camera, the process begins with the NFC/Reading step. To proceed, you must provide the necessary data to unlock the chip. Only one document can be processed at a time. Additional features, such as facial recognition and background check, can be enabled just as they are in the "Enrollment Flow."

In order to use our SDK you need an authorization token. Please check our API "[Authorisation](/docs/kyc/uqudo-api/authorisation.md)" in this regard.

Add the following code at the start-up of your application to initialize the SDK:

```dart
import 'package:uqudosdk_flutter/UqudoIdPlugin.dart';
import 'package:uqudosdk_flutter/uqudosdk_flutter.dart';
...
UqudoIdPlugin.init();
...
```

Use the below method for setting the locale of the application:

```dart
...
UqudoIdPlugin.setLocale(<your locale eg. fr, en etc.>);
...
```

The Uqudo SDK provides a builder class to initiate the "NFC / Reading Flow". See the example below:

```dart
import 'package:uqudosdk_flutter/UqudoIdPlugin.dart';
import 'package:uqudosdk_flutter/uqudosdk_flutter.dart';
...

String result;
try {
  var readingConfiguration = new ReadingBuilder()
      .setToken(token)
      .setDocumentType(DocumentType.UAE_ID)
      .setDocumentNumber("123456789")
      .setDateOfBirth("1980-08-25")
      .setDateOfExpiry("2022-03-06")
      .build();
  result = await UqudoIdPlugin.reading(readingConfiguration);
} on PlatformException catch (exception) {
  result = exception.code;
   // e.g. {"code":"USER_CANCEL","message":"User canceled the Reading process","task":"READING"}
}
```

In order to evaluate all the possible options please refer to section [NFC / Reading Flow](/docs/kyc/uqudo-sdk/integration/android/nfc-reading-flow.md). The dart interface is the porting of the JAVA one. In addition you can check the dart files in the plugin ./lib folder or directly from your IDE.

If **successful**, the response is a JSON Web Signature (JWS). Please refer to section "[SDK result](/docs/kyc/uqudo-sdk/sdk-result.md)" for further details.

In case of a **failure**, the callback returns the following object:

<table><thead><tr><th width="122">Property</th><th width="83">Type</th><th width="99">Optional</th><th width="96">Default</th><th>Description</th></tr></thead><tbody><tr><td>code</td><td>String</td><td>No</td><td>None</td><td>See <a href="/pages/eXcA2qMrXUR1tqYrGTVp#handling-the-result">Handling the Result</a></td></tr><tr><td>message</td><td>String</td><td>Yes</td><td>null</td><td>Description of the error if any</td></tr><tr><td>task</td><td>String</td><td>Yes</td><td>null</td><td>See <a href="/pages/eXcA2qMrXUR1tqYrGTVp#handling-the-result">Handling the Result</a></td></tr></tbody></table>

Add the following event to enable the tracing mechanism as per the code shown below. Please refer to section [Analytics](/docs/kyc/uqudo-sdk/integration/android/analytics.md) for details.

```dart
import 'package:uqudosdk_flutter/UqudoIdPlugin.dart';

class _MyAppState extends State<MyApp> {

  @override
  void initState() {
    super.initState();
    UqudoIdPlugin.init();
    listenNativeEvent();
  }

  static const EventChannel _eventChannel =
      EventChannel('io.uqudo.sdk.id/trace');

  void listenNativeEvent() {
    _eventChannel.receiveBroadcastStream().listen(_onEvent, onError: _onError);
  }

  void _onEvent(Object? event) {
    if (event != null) {
      print("---TraceEvent=${event.toString()}");
    }
  }

  void _onError(Object error) {
    print('---TraceEvent error.');
  }
......
```
