ShieldFraud.iOS
1.0.2
dotnet add package ShieldFraud.iOS --version 1.0.2
NuGet\Install-Package ShieldFraud.iOS -Version 1.0.2
<PackageReference Include="ShieldFraud.iOS" Version="1.0.2" />
paket add ShieldFraud.iOS --version 1.0.2
#r "nuget: ShieldFraud.iOS, 1.0.2"
// Install ShieldFraud.iOS as a Cake Addin #addin nuget:?package=ShieldFraud.iOS&version=1.0.2 // Install ShieldFraud.iOS as a Cake Tool #tool nuget:?package=ShieldFraud.iOS&version=1.0.2
Xamarin Shield Fraud Plugin
Xamarin Plugin for Shield Fraud (www.shield.com)
Xamarin Shield Fraud Plugin helps developers to assess malicious activities performed on mobile devices and return risk intelligence based on user's behaviour. It collects device's fingerprint, social metrics and network information.
There are four steps to getting started with the SHIELD SDK:
Integrate the SDK
Adding the Plugin to your Project
1. Go to Project > Manage NuGet Packages...
2. Search and Select the ShieldFraud.iOS
3. Select under version - 1.0.0
4. Click `Add Package`
Note: We make continuous enhancements to our fraud library and detection capabilities which includes new functionalities, bug fixes and security updates. We recommend updating to the latest SDK version to protect against rapidly evolving fraud risks.
You can refer to the Changelog to see more details about our updates.
Initialize the SDK
The SDK initialization should be configured at the earliest of the App Lifecycle to ensure successful generation and processing of the device fingerprint. SDK is to be initialised only once and will throw an exception if it is initialised more than once.
You need both the SHIELD_SITE_ID and SHIELD_SECRET_KEY to initialize the SDK. You can locate them at the top of the page.
You can initialize the SDK inside AppDelegate.cs
using ShieldFraud;
at the top of the file.Add the following code to the FinishedLaunching() method:
var config = new Configuration("SHIELD_SITE_ID", "SHIELD_SECRET_KEY");
Shield.SetUpWith(config);
Get Session ID
Session ID is the unique identifier of a user’s app session and acts as a point of reference when retrieving the device result for that session.
Session ID follows the OS lifecycle management, in-line with industry best practice. This means that a user’s session is active for as long as the device maintains it, unless the user terminates the app or the device runs out of memory and has to kill the app.
If you would like to retrieve device results using the backend API, it is important that you store the Session ID on your system. You will need to call the SHIELD backend API using this Session ID.
var sessionID = Shield.Shared.SessionId;
Console.WriteLine("SessionID:" + sessionID);
Get Device Results
SHIELD provides you actionable device intelligence which you can retrieve from the SDK, via the Optimized Listener
or Customized Pull method
. You can also retrieve results via the backend API.
Warning: Only 1 method of obtaining device results (Optimized Listener or Customized Pull) can be in effect at any point in time.
Retrieve device results via Optimized Listener
SHIELD recommends the Optimized Listener method to reduce number of API calls.
Our SDK will capture an initial device fingerprint upon SDK initialization and return an additional set of device intelligence ONLY if the device fingerprint changes along one session. This ensures a truly optimized end to end protection of your ecosystem.
You can register a callback if you would like to be notified in the event that the device attributes change during the session (for example, a user activates a malicious tool a moment after launching the page).
Add an additional parameter during intialization in order to register a callback.
var config = new Configuration("SHIELD_SITE_ID", "SHIELD_SECRET_KEY");
config.DeviceShieldCallback = new CallbackExtension();
Shield.SetUpWith(config);
public class CallbackExtension : DeviceShieldCallback {
public override void DidErrorWithError(NSError error) {
Console.WriteLine("Shield Callback Error:" + error);
}
public override void DidSuccessWithResult(NSDictionary<NSString, NSObject> result) {
Console.WriteLine("Shield Callback Success:" + result);
}
}
Retrieve device results via Customized Pull
You can retrieve device results via Customized Pull at specific user checkpoints or activities, such as account registration, login, or checkout. This is to ensure that there is adequate time to generate a device fingerprint.
var latestDeviceResult = Shield.Shared.LatestDeviceResult;
Console.WriteLine(latestDeviceResult);
It is possible that getLatestDeviceResult returns null if the device result retrieval is unsuccessful.
Send Custom Attributes
Use the sendAttributes function to sent event-based attributes such as user_id or activity_id for enhanced analytics. This function accepts two parameters:screenName where the function is triggered, and data to provide any custom fields in key, value pairs.
var keys = new[] {
new NSString("key1"),
new NSString("key2"),
};
var values = new NSString[] {
new NSString("Value1"),
new NSString("Value2")
};
var dict = new NSDictionary<NSString, NSString>(keys, values);
Shield.Shared.SendAttributesWithScreenName("Screen_Name", data);
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
.NET Core | netcoreapp1.0 was computed. netcoreapp1.1 was computed. netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
.NET Standard | netstandard1.4 is compatible. netstandard1.5 was computed. netstandard1.6 was computed. netstandard2.0 was computed. netstandard2.1 was computed. |
.NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
MonoAndroid | monoandroid was computed. |
MonoMac | monomac was computed. |
MonoTouch | monotouch was computed. |
Tizen | tizen30 was computed. tizen40 was computed. tizen60 was computed. |
Universal Windows Platform | uap was computed. uap10.0 was computed. |
Xamarin.iOS | xamarinios was computed. |
Xamarin.Mac | xamarinmac was computed. |
Xamarin.TVOS | xamarintvos was computed. |
Xamarin.WatchOS | xamarinwatchos was computed. |
This package has no dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Initial release.