Skip to content

Commit

Permalink
docs: Update React Native docs with known errors (#292)
Browse files Browse the repository at this point in the history
Signed-off-by: Jakub Koci <jakub.koci@gmail.com>
  • Loading branch information
jakubkoci authored May 25, 2021
1 parent 84e570d commit ec95d83
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,44 @@ const config = {
const agent = new Agent(config)
```

If you're using TypeScript in your React Native project you need to install `indy-sdk` types with alias:

```
yarn add -D @types/rn-indy-sdk@npm:@types/indy-sdk
```

For an example react native app that makes use of the framework see [Aries Mobile Agent React Native](https://github.com/animo/aries-mobile-agent-react-native.git)

#### Known Errors

Error:

```
[Error: crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported]
```

Problem: We're using `uuid` npm package which requires `react-native-get-random-values`.

Solution: Install [react-native-get-random-values](https://github.com/uuidjs/uuid#getrandomvalues-not-supported) and import it in your `index.js` file.

```js
import 'react-native-get-random-values'
```

Error:

```
TypeError: Symbol.asyncIterator is not defined.
```

Problem: Running React Native with Hermes JS engine doesn't support `for-await-of`.

Solution: Install [@azure/core-asynciterator-polyfill](https://github.com/Azure/azure-sdk-for-js/tree/master/sdk/core/core-asynciterator-polyfill) and import it in your `index.js` file.

```js
import '@azure/core-asynciterator-polyfill'
```

### Logs

To enable logging inside the framework a logger must be passed to the agent config. A simple `ConsoleLogger` can be imported from the framework, for more advanced use cases the `ILogger` interface can implemented. See [`TestLogger`](./src/__tests__/logger.ts) for a more advanced example.
Expand Down

0 comments on commit ec95d83

Please sign in to comment.