Unity

This document will guide you tu use our Fleksy Predictive Text SDK package for Unity.

To use the package, please note that you first need a license key which can be requested in the developer’s dashboard.
The below steps assume that you already have an existing project to add Fleksy Predictive Text SDK. If you lack a current project, follow the steps from official Unity documentation to create a new project.

Supported Platforms

Right now, the Predictive Text SDK for Unity is compatible only with Android devices (Android API 26)

Installation

Step 1

Add our package to your Unity project as any other package, from the Unity Package Store or as a custom package from your file system.

You’ll need to import all the assets inside the package:

  • Predictive Text SDK binary for Android (AAR)
  • _FKCoreXR prefab
  • C# Scripts
  • The en-US dictionary inside streaming-assets/enctryted

Step 2

Add the _FKCoreXR prefab to a Unity scene as you would do with any other Unity prefab.

Initialization

Initialise the Predictive Text SDK from any of your components (or add an empty GameObject component with a new empty script attached to it).

To initialise the SDK you’ll need your license details (you can find them in your Fleksy developer portal account).

This script should inherit from FKCoreListener, which has the methods called from the SDK when there are current word predictions, next word predictions and swipe predictions.

public class MainApp : MonoBehaviour, FKCoreListener
{
    private FKCoreXR fKCoreXR;

    void Start()
    {
        fKCoreXR = transform.Find("/_FKCoreXR").GetComponentInChildren<FKCoreXR>();

        fKCoreXR.StartFleksySDK("your-license-key", "your-license-secret");
        fKCoreXR.setListener(this);
    }

    void Update()
    {
        
    }
}

Now you can start using the methods from the _FKCoreKR prefab.

Methods

Additional Resources

For more information, consider checking out the API reference documentation for the respective platform, which documents all the available methods to customize the keyboard built with Fleksy Keyboard SDK.


If something needs to be added or if you find an error in our documentation, please let us know either on our GitHub or Discord.

Last updated on August 24, 2023