1. Install FID SDK

Setup gradle maven

Open build.grade file and add maven line like below

allprojects {
    repositories {
        google()  
        mavenCentral()
        //start add fid sdk maven
        maven {
            url 'https://gitlab.com/api/v4/projects/40140113/packages/maven'
            allowInsecureProtocol true
            credentials(HttpHeaderCredentials) {
                name = "Private-Token"
                value = "{SDK_PRIVATE_KEY}"
            }
            authentication {
                header(HttpHeaderAuthentication)
            }
        }
        //end fid sdk maven
    }
}

Open file app/build.grade then add sdk:

android {
...

 lintOptions {
   checkReleaseBuilds false // add this line
 }
}

dependencies {
...
 implementation 'ai.ftech.fid:sdk:1.2.3.4' //add this line
}

Open file build/grade then add google services

 dependencies {
 ...
 classpath 'com.google.gms:google-services:4.3.14' // add this line
 classpath 'com.google.firebase:firebase-crashlytics-gradle:2.9.5' //add this line
 }

Then go app/build.grade apply google service

plugins {
    ...
    id 'com.google.gms.google-services' // add this line
    id 'com.google.firebase.crashlytics' //add this line
}

Create firebase project then put google-services.json into app folder

Initialize file network-security-config.xml in folder resource xml:

<?xml version="1.0" encoding="utf-8"?>
<network-security-config xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools" tools:ignore="MissingDefaultResource">
    <base-config cleartextTrafficPermitted="true">
        <trust-anchors>
            <certificates src="system" />
        </trust-anchors>
    </base-config>
</network-security-config>

Open Manifest.xml and call file network-security-config.xml and add LICENSE_KEY

<application
        android:name="ai.ftech.fid.FApplication"
        android:networkSecurityConfig="@xml/network_security_config"
        android:roundIcon="@mipmap/ic_launcher_round"
        android:supportsRtl="true"
        android:theme="@style/Theme.FIDAuthentication">
        
         <meta-data
            android:name="fid.sdk.license"
            android:value="{YOUR_LISCENSE_KEY}" />
</application>
  <activity
            android:name=".MainActivity"
            android:exported="true">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
            <intent-filter>
                <action android:name="android.intent.action.VIEW" />
                <category android:name="android.intent.category.DEFAULT" />
                <category android:name="android.intent.category.BROWSABLE" />
                <data android:scheme="https" android:host="{GAME_HOST_1}" />
            </intent-filter>
            <intent-filter>
                <action android:name="android.intent.action.VIEW" />
                <category android:name="android.intent.category.DEFAULT" />
                <category android:name="android.intent.category.BROWSABLE" />
                <data android:scheme="https" android:host="{GAME_HOST_2}" />
            </intent-filter>
    </activity>

Initialize FID in file Application

@Override
public void onCreate() {
    super.onCreate();
    //FidConfig.ENVIRONMENT: DEVELOPMENT, STAGGING, PRODUCTION
    FID.INSTANCE.init(this, FidConfig.ENVIRONMENT.DEVELOPMENT);
    FPay.INSTANCE.init(this);
}

Last updated