text document proxy insert text on background

Hi,


We have created a custom virtual keyboard that implements the UIInputViewController

class that has an insertText function that adds text to the keyboard and writes it.

If you are on the Containing App It writes fine. The problem is when

you are in another application it doesn't write nothing.

The values we need to write are sent to us by a BLE device via bluetooth.


This function of the KeyboardViewController class that implements

the UiInputViewController class inserts text on the keyboard.


func sendKey(texto: String){

let proxy = self.textDocumentProxy

proxy.insertText(texto)

}

Any idea?


Thank you.

Replies

Did you configure the app to receive such events when in background ?


https://stackoverflow.com/questions/55401888/how-to-keep-receiving-the-data-when-app-is-sent-to-background-mode

Hi,

yes, I have check Background Modes:



I have verified that the method is executed by writing to a file but it doesnt write on keyboard.

I have verified that the method is executed by writing to a file but it doesnt write on keyboard.

Do you mean that thext is effectively typed but does not show on keyboard ? Where is it supposed to show ?


Found this tutorial, but I understand you already know all this

h ttps://www.raywenderlich.com/49-custom-keyboard-extensions-getting-started

for example, if i open a word/excel file i want to write values on it.

if i open a word/excel file i want to write values on it.

Sorry, that's not totally clear for me:

it: do you mean in Excel or do you mean on the keyboard suggestion line ?


Would you have a demo project to share ?

Yes, in this link


https://we.tl/t-Ox3vTxl03e