FoxHat
    FoxHat
    • 👋Introduction
    • 🌐Browser SDK
    • 🤖Android SDK
    • 😀Flutter SDK
    • 🍎Ios SDK (Soon!)
    • BackEnd APIs
      • Verify Token
        POST
      • Link
        POST

    😀Flutter SDK

    Integrating FoxHat Flutter#

    This guide will explain how to integrate FoxHat AntiSpam into your Android application .

    Features#

    Emulator detection
    Rooting detection
    Detection of debugging activities
    Detection of frameworks (e.g., Frida, Xposed, Shadow)
    Secure Api

    Adding FoxHat to Your Project#

    INFO
    Download FoxHat.aar

    Step 1: Add the .aar File to Your Project#

    1.
    Copy the downloaded .aar file into the android/app/libs/FoxHat.aar directory of your Android project.
    This will add a line like this to your package's pubspec.yaml (and run an implicit flutter pub get):

    Initializing FoxHat#

    Once installed, the SDK needs to be configured using your Publishable Key, which can be found in the Dashboard .
    📌
    Emulator and Root Detection enabled by default
    import 'package:foxhat_flutter/foxhat_flutter.dart';
    final _foxhatFlutterPlugin = FoxHat();
    await _foxhatFlutterPlugin.init("your_public_key");

    Creating tokens#

    The SDK generates a token, which is a required field in the Risk and Filter APIs.
    📌
    It's recommended that you forward the request token as a request header to every request to your API, since then you won't need to update the app whenever you're adding new server-side calls to Castle. The default value of the header is X-FoxHat-Token, but you can specify the header name in the SDK configuration.

    Token Expiration#

    A new request token value should to be generated for each request to your backend. A request token will expire after 60 seconds and should only be used during a single request to your backend. It's recommended that you implement the token generation as a client-side middleware which generates a new request token with each request to your backend.
    const  token = await _foxhatFlutterPlugin.getToken() ??
    Map<String, String> requestHeaders = {};
    requestHeaders["X-FoxHat-Token"] = requestToken;
    Modified at 2024-11-04 21:09:58
    Previous
    🤖Android SDK
    Next
    🍎Ios SDK (Soon!)
    Built with