Skip to content

Commit

Permalink
Release MAUI v1.0.0/ Android v9.0.3 / iOS v11.0.3
Browse files Browse the repository at this point in the history
  • Loading branch information
Miquel-Martinez authored Mar 1, 2024
2 parents 14e2e8c + d913a68 commit 7510d03
Show file tree
Hide file tree
Showing 11 changed files with 564 additions and 3 deletions.
3 changes: 0 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,6 @@ autom4te.cache/
tarballs/
test-results/

# Credentials file
ExampleAppMAUI/Credentials.cs

# Mac bundle stuff
*.dmg
*.app
Expand Down
File renamed without changes.
2 changes: 2 additions & 0 deletions ExampleAppMAUI/ExampleAppMAUI.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,8 @@

<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="8.0.0" />
<PackageReference Include="Microsoft.MAUI.Controls" Version="$(MauiVersion)" />
<PackageReference Include="Microsoft.Maui.Controls.Compatibility" Version="$(MauiVersion)" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net8.0-android'">
Expand Down
48 changes: 48 additions & 0 deletions LICENSE.md
Original file line number Diff line number Diff line change
@@ -1 +1,49 @@
# iProov.NET.iOS

Please refer to the iOS Biometrics SDK license [here](https://github.com/iProov/ios/blob/master/LICENSE.md).

# iProov.NET.Android

Please refer to the Android Biometrics SDK license [here](https://github.com/iProov/android/blob/master/LICENSE.md).

# iProov.NET.MAUI
Please refer to the aformentioned [Android](https://github.com/iProov/android/blob/master/LICENSE.md) and [iOS](https://github.com/iProov/ios/blob/master/LICENSE.md) licenses.

# API Client/Sample Code

Copyright 2021 iProov Limited

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.

2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.

3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

This library makes use of the following third party libraries:

### Newtonsoft.Json

The MIT License (MIT)

Copyright (c) 2007 James Newton-King

Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
122 changes: 122 additions & 0 deletions Nuget Packages/iProov.NET.Android/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
# iProov.NET.Android NuGet

## Introduction

The iProov.NET.Android NuGet enables you to integrate iProov's SDK into your .NET Android projects.

This NuGet wraps iProov's existing native [Android](https://github.com/iProov/android) SDK behind a .NET interface for use from within your .NET app.

## Requirements

- NET 8 (net8-android)
- Android API Level 21 (Android 5 Lollipop) and above

## How to use it

1. Using the NuGet Package Manager, add the [iProov.NET.Android](https://www.nuget.org/packages/iProov.NET.Android/) package to your project. For further instructions on how to install and manage packages, [see here](https://learn.microsoft.com/en-us/nuget/consume-packages/install-use-packages-visual-studio).

2. Import the package into your project with `using iProov.NET.Android;`

3. Create an instance of IProovCallbackLauncher

```csharp
IProovCallbackLauncher iProovLauncher = new IProovCallbackLauncher();
```

4. Create a private class which implements `IProovCallbackLauncher.IListener` to handle the callbacks from the Android SDK:

```csharp
private IProovListener listener = new IProovListener();

private class IProovListener : Java.Lang.Object, IProov.IListener
{

public void OnConnected()
{
// Called when the SDK is connecting to the server. You should provide an indeterminate
// progress indication to let the user know that the connection is being established.
}

public void OnConnecting()
{
// The SDK has connected, and the iProov user interface will now be displayed. You
// should hide any progress indication at this point.
}
public void OnCanceled(IProov.Canceler canceler)
{
// Either the user canceled iProov by pressing the Close button at the top right or
// the Home button (canceler == USER)
// Or the app canceled using Session.cancel() (canceler == APP).
// You should use this to determine the next step in your flow.
}
public void OnError(IProovException error)
{
// The user was not successfully verified/enrolled due to an error (e.g. lost internet connection)
// along with an IProovException.
// It will be called once, or never.
}
public void OnFailure(IProov.FailureResult result)
{
// The user was not successfully verified/enrolled, as their identity could not be verified,
// or there was another issue with their verification/enrollment. A reason (as a string resource id)
// is provided as to why the claim failed, along with a feedback code from the back-end.
var feedbackCode = result.FeedbackCode;
var reason = result.Reason.Description;
}
public void OnProcessing(double progress, string message)
{
// The SDK will update your app with the progress of streaming to the server and authenticating
// the user. This will be called multiple times as the progress updates.
}
public void OnSuccess(IProov.SuccessResult result)
{
// The user was successfully verified/enrolled and the token has been validated.
// You must always independently validate the token server-side (using the /validate API call)
// before performing any authenticated user actions.
}

}

```

> Alternatively you could just implement `IProov.IListener` on your `Activity` class.

5. You must register the iProov listener when your Activity is created:

```csharp

IProovCallbackLauncher iProovLauncher = new IProovCallbackLauncher();
IProovListener listener = new IProovListener();

protected override void OnCreate(Bundle savedInstanceState)
{
base.OnCreate(savedInstanceState);
iProovLauncher.Listener = listener;
// ...continue your activity setup ...
}
```

...and unregister it when destroyed:

```csharp
protected override void OnDestroy()
{
iProovLauncher.Listener = null;
base.OnDestroy();
}
```

6. Once you have obtained a token (either via the [.NET API Client](https://github.com/iProov/dotnet-maui/tree/master/APIClient) or other means), you can now launch iProov by calling:

```csharp
iProovLauncher.Launch(this, "wss://eu.rp.secure.iproov.me/ws", token, new IProov.Options()); // Substitute the streaming URL as appropriate
```

👉 You should now familiarise yourself with the [iProov Android SDK documentation](https://github.com/iProov/android) which provides comprehensive details about the available customization options and other important details regarding the Android SDK usage.
Binary file not shown.
Binary file removed Nuget Packages/iProov.NET.MAUI.1.0.0.nupkg
Binary file not shown.
Binary file not shown.
75 changes: 75 additions & 0 deletions Nuget Packages/iProov.NET.iOS/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
# iProov.NET.iOS Nuget

## Introduction

The iProov.NET.iOS NuGet enables you to integrate iProov's SDK into your .NET iOS projects.

This NuGet wraps iProov's existing native [iOS](https://github.com/iProov/ios) SDK behind a .NET interface for use from within your .NET app.

## Requirements

- NET 8 (net8-ios)
- iOS 12 and above


## How to use it

1. Using the NuGet Package Manager, add the [iProov.NET.iOS](https://www.nuget.org/packages/iProov.NET.iOS/) package to your project. For further instructions on how to do this, [see here](https://learn.microsoft.com/en-us/nuget/consume-packages/install-use-packages-visual-studio).

2. Add a "Privacy - Camera Usage Description" entry to your Info.plist file with the reason why your app requires camera access (e.g. "To iProov you in order to verify your identity.")

3. Import the package into your project with `using iProov.NET.iOS;`

4. Once you have obtained a token (either via the [.NET API Client](https://github.com/iProov/dotnet-maui/tree/master/APIClient) or other means), you can launch the iProov iOS SDK as follows:

```csharp
IProov.LaunchWithStreamingURL(new NSUrl("wss://eu.rp.secure.iproov.me/ws"), token, new IPOptions(), // Substitute streaming URL as appropriate
connecting: () =>
{
// The SDK is connecting to the server. You should provide an indeterminate progress indicator
// to let the user know that the connection is taking place.
},
connected: () =>
{
// The SDK has connected, and the iProov user interface will now be displayed. You should hide
// any progress indication at this point.
},
processing: (progress, message) =>
{
// The SDK will update your app with the progress of streaming to the server and authenticating
// the user. This will be called multiple time as the progress updates.
},
success: (result) =>
{
// The user was successfully verified/enrolled and the token has been validated.
// You can access the following properties:
var token = result.Token; // The token passed back will be the same as the one passed in to the original call
var frame = result.Frame; // An optional image containing a single frame of the user, if enabled for your service provider
},
canceled: (canceler) =>
{
// Either the user canceled iProov by pressing the Close button at the top left or sending
// the app to the background. (canceler == USER)
// Or the app canceled using Session.cancel() (canceler == APP).
// You should use this to determine the next step in your flow.
},
failure: (result) =>
{
// The user was not successfully verified/enrolled, as their identity could not be verified,
// or there was another issue with their verification/enrollment. A reason (as a string)
// is provided as to why the claim failed, along with a feedback code from the back-end.
var reason = result.Reason
var description = result.LocalizedDescription;
},
error: (error) =>
{
// The user was not successfully verified/enrolled due to an error (e.g. lost internet connection).
// You will be provided with an NSError. You can check the error code against the IPErrorCode constants
// to determine the type of error.
// It will be called once, or never.
}
);
```
> Note that the launch method requires the url to be passed as a **NSURL**
👉 You should now familiarise yourself with the [iProov iOS SDK documentation](https://github.com/iProov/ios) which provides comprehensive details about the available customization options and other important details regarding the iOS SDK usage.
Binary file not shown.
Loading

0 comments on commit 7510d03

Please sign in to comment.