Handling (or disabling) Memoji in InputBarAccessoryView TextField - ios

I'm building a chat app using MessageKit, Firebase and InputBarAccessoryView pods.
I've found out that when I input a Memoji (aka sticker) in the textfield of the InputBar and press the "send" button, in the database the Memoji will be saved as "\n", which of course will be rendered as a blank bubble in the receiving user screen. The issue is exclusive to Memoji, regular emojis works fine.
Before sending, I already check if the user is trying to send an empty string, and if the case the message is not sent at all to the database, but I don't know how to check if a Memoji is being input.
Plus, in the textbar the Memoji is rendered awfully, see pic here, so the best solution would be cutting the problem at its roots and removing the option to input Memoji in the textfield or directly removing them from the keyboard.
I'm searching for a way to to remove Memoji from users keyboard, or to handle at best these issues, but i've found nothing googling.

Memojis work this way: when selected from the keyboard, they are pasted into the TextView.
So i just found a decent solution directly from the InputBar API:
messageInputBar.inputTextView.isImagePasteEnabled = false
This removes the possibility to paste images in the TextView, and alongside Memojis are removed from the keyboard.

Related

Predicitve text/suggestion above keyboard doesn't work?

My whole Xcode project has a weird behaviour,dont know what is causing this issue I am getting prediction and suggestions above my keyboard, but when I click on the text it doesn't call any method or when I try clicking on the predicited text it doesn't work.
is there by chance because of using third party pods?have tried all types of textContentType I get suggestion like name,phonenumber,otp but unfortunately when I tap on it it doesn't work
its behaviour is literally like the predicition has user interaction disabled

How to read text from custom keyboard from third party apps like skype, whats up and so on?

How to read text from custom keyboard from third party apps like Skype, whats up and so on?
Step1: I have to create custom keyboard in swift ios

Step2: Enable and add custom keyboard in ios device.

Step3: User will open skype and chat using custom keyboard .

Step 4: I need to read text or detect text or get text , user typed text from third party apps like skype , whats up, message and so on.


 Eg: User open skype and chat using custom keyboard like "Hello" . I wants to read text or get text or detect text as Hello using ios swift.
If you have created your own custom keyboard, then you are the one who implemented creating the text from the keyboard -> it should be super easy to record the user input (since you are generating it). E.g., if you generate a character using:
self.textDocumentProxy.insertText(characterString)
Then just at the same moment track that character:
self.textGeneratedInThisSession = self.textGeneratedInThisSession + characterString
Assuming there is textGeneratedInThisSession variable into which you are appending the text.
Moreover, at any moment you can just examine the content of self.textDocumentProxy which gives you the power to find out even the content of the document proxy that was generated by other keyboards, e.g.:
let contentDescription = textDocumentProxy.description
Read more in UITextDocumentProxy documentation.
However, you should know that this is something Apple is very sensitive about. Recording the text and leaking it anywhere might very easily end in rejection of the custom keyboard.

resignFirstResponder() in Third-Party Keyboards

I have a third party keyboard that currently contains a UISearchBar(that is first responder on start) and the user is able to search for content (i.e. gifs) to be able to copy, paste, send to friends, etc.
In theory, after entering text in the bar and pressing search, the user should be able to enter text in the application's actual UITextView (i.e. the message field in the messages app) but for some reason this doesn't work and although typing works, nothing actually appears.
I have tried searchBar.resignFirstResponder(), self.becomeFirstResponder() and many combinations of .endEditing(true) to no avail.
I know it is possible to do this as apps like Giffy do it but I can't figure it out for the life of me.
Any help would be greatly appreciated.
Keyboard extensions with built-in search bars usually implement their search bar as a UILabel, adding custom text handling behavior that modifies the text property of the label based on user input.

Custom emoticon keyboard IOS

I am currently in the process of building a custom keyboard for IOS devices and wanted to add a custom EMOJI keyboard as well. I have a sheet of custom emoticons already created and do not want the user to have to copy and paste into their message like on the Ikea Emoticon keyboard. Is it possible to have a clone of apples keyboard functionality but with my own emoticons?
If you have something similar like below (emoticon icon)
You can make a slideout UIView with a bunch of your custom emojis using UICollectionView. If the user taps on an emoji it would insert your own Unicode Emoji Text (just example).
You will have to make your own if statements if the text contains emoji unicode to make the emojis appear in your text.
This is how I understand it, I might be wrong, if so, please correct me. :)

Corona sdk text input

I have looked at example code that uses the native textField on Android. I would like to be able to type into the text field without having to touch a button to show the text field, and then touch inside the text field to start typing. Is there a way to show the text field and set focus to it, where I can start typing without touching other buttons. I am working on an app and I don't want the users to have to take extra steps to begin typing text. Thanks for any advice.
You can call native.setKeyboardFocus(yourField) to show the keyboard.
http://docs.coronalabs.com/api/library/native/setKeyboardFocus.html

Resources