This document will guide you to use our Fleksy Predictive Text SDK package for Unity.
Right now, the Predictive Text SDK for Unity is compatible only with Android devices (Android API 26
)
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 assets inside the package:
Add the _FKCoreXR prefab to a Unity scene as you would do with any other Unity prefab.
Initialise the Predictive Text SDK from any of your components (or add an empty GameObject component with a new empty script attached to it).
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.
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.