Swiftpack.co - fingerprintjs/fingerprintjs-pro-ios as Swift Package

Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
See all packages published by fingerprintjs.
fingerprintjs/fingerprintjs-pro-ios 1.1.0
Official iOS agent & SDK for 100% accurate device identification, created for the FingerprintJS Pro Server API.
⭐️ 25
🕓 16 weeks ago
iOS
.package(url: "https://github.com/fingerprintjs/fingerprintjs-pro-ios.git", from: "1.1.0")

FingerprintJS

Discord server

FingerprintJS Pro iOS

Official iOS agent & SDK for 100% accurate device identification, created for the FingerprintJS Pro Server API.


// Trust your user's identifiers with the FingerprintJS Pro

FingerprintJSProFactory
    .getInstance(
        token: "my-api-token",
        endpoint: nil, // optional
        region: nil // optional
    )
    .getVisitorId { result in
        switch result {
        case let .failure(error):
            print("Error: ", error.localizedDescription)
        case let .success(visitorId):
            // Prevent fraud cases in your apps with a unique
            // sticky and reliable ID provided by FingerprintJS Pro.
            print("Success: ", visitorId)
        }
    }

#1 library for iOS device identification

FingerprintJS Pro is a professional visitor identification service that processes all information server-side and transmits it securely to your servers using server-to-server APIs.

Retrieve an accurate, sticky an stable FingerprintJS Pro visitor identifier in an iOS app. This library communicates with the FingerprintJS Pro API and requires a token.

If you are interested in the Android platform, you can also check our FingerprintJS Pro Android.

Quick start

Integrate the FingerprintJS Pro iOS framework to your project. The framework collects various signals from the iOS system, sends them to the FingerprintJS Pro API for processing, and retrieves a very accurate and stable identifier.

1. Installation

CocoaPods

Specify the following dependency in your Podfile:

pod 'FingerprintJSPro', '~> 1.1.0'

Swift Package Manager

Add the following dependency to your Package.swift.

dependencies: [
    .package(url: "https://github.com/fingerprintjs/fingerprintjs-pro-ios-integrations", .upToNextMajor(from: "1.1.0"))
]

2. Import

import FingerprintJSPro

3. Get the visitor identifier

You can find your browser api token in your dashboard.

FingerprintJSProFactory
    .getInstance(
        token: "your-browser-token",
        endpoint: nil, // optional
        region: nil // optional
    )
    .getVisitorId { result in
        switch result {
        case let .failure(error):
            print("Error: ", error.localizedDescription)
        case let .success(visitorId):
            print("Success: ", visitorId)
        }
    }

Params

  • token: string - API token from the FingerprintJS dashboard
  • endpoint: URL? - nil for default endpoint, possible format for custom endpoint: URL(string: "https://fp.yourdomain.com")
  • region: String? - nil for the Global region, eu for the European region

Tags support

FingerprintJSProFactory
    .getInstance(
        token: "your-browser-token",
        endpoint: nil, // optional
        region: nil // optional
    )
    .getVisitorId(tags: ["sessionId": sessionId]) { result in
        switch result {
        case let .failure(error):
            print("Error: ", error.localizedDescription)
        case let .success(visitorId):
            print("Success: ", visitorId)
        }
    }

Additional Resources

License

This library is MIT licensed.

GitHub

link
Stars: 25
Last commit: 1 week ago
jonrohan Something's broken? Yell at me @ptrpavlik. Praise and feedback (and money) is also welcome.

Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics