Skip to content

Commit

Permalink
v2.2.8+1 release (#338)
Browse files Browse the repository at this point in the history
* Fix/clibs (#336)

* new c libraries

* example app qr code scanner

* cleaning and formatting

* README updates (#335)

---------

Co-authored-by: Justin LeBlanc <leblanc@wustl.edu>
  • Loading branch information
plusema86 and famousj authored Oct 31, 2023
1 parent ea76f85 commit 2a994fa
Show file tree
Hide file tree
Showing 22 changed files with 131 additions and 303 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
## 2.2.8+1
- Fixed protocol libraries that caused issues with iOS devices

## 2.2.8
- Improved performance on iOS devices
- Schema caching
Expand Down
85 changes: 39 additions & 46 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

# Polygon ID Flutter SDK

[![pub package](https://img.shields.io/badge/pub-2.2.8-blueviolet)](https://pub.dev/packages/polygonid_flutter_sdk)
[![pub package](https://img.shields.io/badge/pub-2.2.8+1-blueviolet)](https://pub.dev/packages/polygonid_flutter_sdk)
[![build](https://github.com/iden3/polygonid-flutter-sdk/workflows/polygonid_flutter_sdk/badge.svg)](https://github.com/iden3/polygonid-flutter-sdk/actions?query=workflow%3Apolygonid_flutter_sdk)
[![codecov](https://codecov.io/gh/iden3/polygonid-flutter-sdk/branch/develop/graph/badge.svg?token=0SI0XWGXKL)](https://codecov.io/gh/iden3/polygonid-flutter-sdk)
[![license](https://img.shields.io/badge/license-Apache--2.0-blue.svg)](https://github.com/iden3/polygonid-flutter-sdk/blob/master/LICENSE-APACHE)
Expand All @@ -14,6 +14,8 @@

This is a Flutter plugin for the [Polygon ID SDK](https://polygon.technology/polygon-id), which allows you to integrate Polygon ID identity system into your Flutter apps.

Please see the [example app](https://github.com/iden3/polygonid-flutter-sdk/tree/develop/example) included in the repository and follow the [Polygon ID Wallet SDK Documentation](https://0xpolygonid.github.io/tutorials/wallet/wallet-sdk/polygonid-sdk/polygonid-sdk-overview/).

## Installation

To use this plugin, add `polygonid_flutter_sdk` as a [dependency](https://flutter.io/using-packages/) in your `pubspec.yaml` file like this
Expand All @@ -34,25 +36,17 @@ dependencies:
ref: branchPathName
```

# Environment
### App side
You need to set the environment you are working on in the SDK.
## Usage

You can either set the environment during initialization (with `env` parameter) or later with [PolygonIdSdk.setEnv()](lib/sdk/polygon_id_sdk.dart#L70).
To integrate Polygon ID Flutter SDK into your Flutter app, follow these steps:

The environment object is [EnvEntity](lib/common/domain/entities/env_entity.dart) with:
```
final String blockchain; # The name of the blockchain (eg: polygon)
final String network; # The network of the blockchain (eg: mumbai)
final String web3Url; # URL of the blockchain (eg: https://polygon-mumbai.infura.io/v3/)
final String web3RdpUrl; # RDP URL (eg: wss://polygon-mumbai.infura.io/v3/)
final String web3ApiKey; # The API key of the web3 URL service (eg: YOUR-INFURA-API-KEY)
final String idStateContract; # The ID state contract (eg: 0x134B1BE34911E39A8397ec6289782989729807a4)
final String pushUrl; # The push notification URL (eg: https://push-staging.polygonid.com/api/v1)
final String ipfsUrl; # The ipfs API URL (eg: https://[YOUR-IPFS-API-KEY]:[YOUR-IPFS-API-KEY-SECRET]@ipfs.infura.io:5001)
1. Import the `polygonid_flutter_sdk` package:

```dart
import 'package:polygonid_flutter_sdk/sdk/polygon_id_sdk.dart';
```
2. Initialize the Polygon ID Flutter SDK with your environment:

An example of initialization:
```dart
import 'package:flutter/material.dart';
import 'package:polygonid_flutter_sdk/sdk/polygon_id_sdk.dart';
Expand All @@ -72,6 +66,35 @@ Future<void> main() async {
}
```

See [below](#environment) for details about setting up the environment.

3. To be able to authenticate with issuers or verifiers, fetch credentials and generate proofs, you need to download the proof circuit files.

```dart
Stream<DownloadInfo> stream =
await PolygonIdSdk.I.proof.initCircuitsDownloadAndGetInfoStream;
```
For more information on how to use the PolygonID Flutter SDK, please check the [example app](https://github.com/iden3/polygonid-flutter-sdk/tree/develop/example) included in the repository and follow the [Polygon ID Wallet SDK Documentation](https://0xpolygonid.github.io/tutorials/wallet/wallet-sdk/polygonid-sdk/polygonid-sdk-overview/)

<a href="env"></a>
# Environment
### App side
You need to set the environment you are working on in the SDK.

You can either set the environment during initialization (with `env` parameter) or later with [PolygonIdSdk.setEnv()](lib/sdk/polygon_id_sdk.dart#L70).

The environment object is [EnvEntity](lib/common/domain/entities/env_entity.dart) with:
```
final String blockchain; # The name of the blockchain (eg: polygon)
final String network; # The network of the blockchain (eg: mumbai)
final String web3Url; # URL of the blockchain (eg: https://polygon-mumbai.infura.io/v3/)
final String web3RdpUrl; # RDP URL (eg: wss://polygon-mumbai.infura.io/v3/)
final String web3ApiKey; # The API key of the web3 URL service (eg: YOUR-INFURA-API-KEY)
final String idStateContract; # The ID state contract (eg: 0x134B1BE34911E39A8397ec6289782989729807a4)
final String pushUrl; # The push notification URL (eg: https://push-staging.polygonid.com/api/v1)
final String ipfsUrl; # The ipfs API URL (eg: https://[YOUR-IPFS-API-KEY]:[YOUR-IPFS-API-KEY-SECRET]@ipfs.infura.io:5001)
```

### Supported Environments

| Environment | Polygon Mumbai | Polygon Main |
Expand Down Expand Up @@ -127,36 +150,6 @@ post_install do |installer|
end
end
```
## Usage

To integrate Polygon ID Flutter SDK into your Flutter app, follow these steps:

1. Import the `polygonid_flutter_sdk` package:

```dart
import 'package:polygonid_flutter_sdk/sdk/polygon_id_sdk.dart';
```
2. Initialize the Polygon ID Flutter SDK with your environment:

```dart
await PolygonIdSdk.init(env: EnvEntity(
blockchain: 'polygon',
network: 'mumbai',
web3Url: 'https://polygon-mumbai.infura.io/v3/',
web3RdpUrl: 'wss://polygon-mumbai.infura.io/v3/',
web3ApiKey: 'YOUR-INFURA-API-KEY',
idStateContract: '0x134B1BE34911E39A8397ec6289782989729807a4',
pushUrl: 'https://push-staging.polygonid.com/api/v1',
ipfsUrl: "https://[YOUR-IPFS-API-KEY]:[YOUR-IPFS-API-KEY-SECRET]@ipfs.infura.io:5001",
));
```
3. To be able to authenticate with issuers or verifiers, fetch credentials and generate proofs, you need to download the proof circuit files.

```dart
Stream<DownloadInfo> stream =
await PolygonIdSdk.I.proof.initCircuitsDownloadAndGetInfoStream;
```
For more information on how to use the PolygonID Flutter SDK, please check the [example app](https://github.com/iden3/polygonid-flutter-sdk/tree/develop/example) included in the repository and follow the [Polygon ID Wallet SDK Documentation](https://0xpolygonid.github.io/tutorials/wallet/wallet-sdk/polygonid-sdk/polygonid-sdk-overview/)

## Issues and Contributions

Expand Down
2 changes: 1 addition & 1 deletion example/lib/src/presentation/navigations/routes.dart
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ class Routes {

///
static WidgetBuilder _qrCodeScannerRoute() {
return (BuildContext context) => const QRViewExample();
return (BuildContext context) => const QRCodeScannerPage();
}

///
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/*
import 'dart:math';
import 'dart:ui';
import 'dart:ui' as ui;
Expand Down Expand Up @@ -97,4 +96,3 @@ class BarcodeDetectorPainter extends CustomPainter {
oldDelegate.barcodes != barcodes;
}
}
*/
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/*
import 'dart:io';

import 'package:camera/camera.dart';
Expand Down Expand Up @@ -461,4 +460,3 @@ class _CameraViewState extends State<CameraView> {
});
}
}
*/
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/*
import 'dart:io';
import 'dart:ui';

Expand Down Expand Up @@ -35,4 +34,3 @@ double translateY(
return y * size.height / absoluteImageSize.height;
}
}
*/
Loading

0 comments on commit 2a994fa

Please sign in to comment.