FKInterfaceDelegate

Delegate to receive events from the keyboard.

FKInterfaceDelegate depend on the creation of the KeyboardViewController.

Summary

Method Description
eventBus Invoked when we receive a notification subscribed.
sesssionStarted Invoked at the beginning of data collection data.
sesssionEnded Invoked at the end of data collection data.
dataCollection Invoked at the end of the session with all data captured.
dataCollectionFromDict Invoked at the end of the session with all data captured, format dictionary.
onDataCaptureEvent Invoked when the event-based data capture is enabled.
reportAnalytics Invoked at the end of the session with all internal analytics reported.
contextPropertiesChanged Invoked at the beginning of the session with the properties.
onLayoutChanges Invoked when we start up the keyboard and every time the layout changes.
triggerOpenApp Invoked when the button on the topbar is pressed.

EventBus

- (void) eventBus:(NSString *)event payload:(NSDictionary *)dictPayload;

Called when a notification is triggered by the SDK. Notification with name: event, and payload: dictPayload. Specification of events and payload in subscribeEventBus description.

SessionStarted

- (void) sessionStarted:(NSString *)sessionId;

Implement this method to get notified that a new keyboard session started.

SessionEnded

- (void) sessionEnded:(NSString *)sessionId;

Implement this method to get notified that an existing keyboard session ended.

DataCollection

- (void) dataCollection:(NSString *)data sessionId:(NSString *)sessionId;

Called when we are ready to report data collected during the session. This method receives data in string format. Data Component explains in detail the data collected.

DataCollectionFromDict

- (void)dataCollectionFormatDict:(NSDictionary *)data sessionId:(NSString *)sessionId;

Called when we are ready to report data collected during the session formatted as a dictionary. Data Component explains in detail the data collected.

onDataCaptureEvent

override func onDataCaptureEvent(_ event: EventBasedDataCaptureEvent) {
}

This method reports all different changes on the data capture while it happens. To enable this method you need two different elements:

  1. Have this capability enabled in the developer portal.
  2. Configure the keyboardConfiguration with the Event-based data capture

You can check all different data elements that the system will start to report to you.

ReportAnalytics

- (void) reportAnalytics:(NSDictionary *)data;

Called when we are about to close the keyboard with all the data, collected during the session. This should be enabled with this setting: FLEKSY_SETTINGS_REPORT_ANALYTICS, by default this is disabled.

data is a dictionary with different internal analytics that might be relevant.

Keys of first level:

Key Object Description
correction <dictionary> All specific analytics for auto correction.

Keys second level, Key correction:

Key Object Description
none <number> Number of words not corrected.
missingSpace <number> Number of corrections done due to missing a space.
missTypedSpace <number> Number of corrections done due to typing an unwanted space.
eliminated <number> Number of corrections done to eliminate characters.
transposition <number> Number of corrections done by changing the order or characters.
missingTaps <number> Number of corrections done when a word misses taps (characters).
others <number> Number of corrections not related to all other cases. This includes corrections directly from the dictionary and other outcome types.

Example:

@{@"correction":@{@"none":2,
                  @"missingSpace":0,
                  @"missTypedSpace":1,
                  @"eliminated":2,
                  @"transposition":0,
                  @"missingTap":3,
                  @"others":1}};

ContextPropertiesChanged

- (void) contextPropertiesChanged:(KeyboardProperties*) properties;

Called when the keyboard is opened or when some of the KeyboardProperties change during the current session.

KeyboardProperties elements:

appName String with the name of the current app where the user is executed.
textFieldType UIKeyboardType with the current textfield type.

OnLayoutChanges

- (void) onLayoutChanges:(NSDictionary*)dictLayout;

Called when the layout changes the keys/positions.

Note:

  • This is only intedend to be used in debug mode as the method is costly.
  • It needs to be enabled in DebugConfiguration.

Parameters:

layout Holds an Array of FleksyDebugLayoutSDK, which contains frame, element and type.
suggestions Holds an Array of FleksyDebugLayoutSDK, which contains frame, element and type.
keyboardArea Holds an object of FleksyDebugRectSDK for the keyboardArea based on the device points. It gives x,y, width, height of the whole keyboard area.

TriggerOpenApp

- (void) triggerOpenApp;

Called when button on the topbar is pressed. Any action can be performed here.


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 May 22, 2024