resignFirstResponder() in Third-Party Keyboards - ios

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.

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

Handling (or disabling) Memoji in InputBarAccessoryView TextField

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.

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

How to enter text into a textfield in a web view using UIAutomation

My iOS app has a log-in page with username and password textfields. These text fields are in a web view. I am trying to automate the log-in process with UIAutomation. I know that working with content in a web view with UIAutomation is tricky. I am able to tap into the text fields using target.tap({x:100, y:200}); but I want to have UIAutomation enter text after the field has been tapped. How can I achieve this?
You can do something like:
Get the reference to the webview
var webView=window.scrollViews()[0].webViews()[0];
Tap the textView that you want to edit:
webView.textFields()[0].tap();
Use the keyboard
UIATarget.localTarget().frontMostApp().keyboard().typeString("text");
You can use: webView.logElementTree() to find out your webview.
Yes this is quite possible but instead of going through the position of the text field, I'd suggest going through the id/name of the text field. Another approach is to traverse the application window.
Try following this apple's documentation - http://developer.apple.com/library/ios/#documentation/DeveloperTools/Conceptual/InstrumentsUserGuide/UsingtheAutomationInstrument/UsingtheAutomationInstrument.html
This will give you a head start and many other ideas.

How can I show the numeric virtual keyboard on the Blackberry Storm?

I'm having some difficulty showing the virtual keyboard I want for the Blackberry Storm. I have an option to toggle the keyboard's visibility on a certain screen. Whenever the user types a number, it's handled by the screen, rather than any particular field (there are no textfields on this screen). This much works fine. I can show and hide the keyboard when the user chooses to.
My question is this: How do I make the keyboard that shows up the same as what would appear had the focus been on a BasicEditField with a numeric filter applied, without using a BasicEditField for the input?
I don't think BlackBerry has exposed any APIs to allow for programmatic control over the type of virtual keyboard that is shown. I seem to remember reading about it in the BB forums (although unfortunately I can't find it now).
One thing you could try doing is using a BasicEditField with a numeric field, but place it offscreen so that it isn't visible. When you want to capture numeric input from the user, put focus on that element. I haven't tried this, it's just a thought.

Resources