0

I have a textfield where i need the user to select an emoji to proceed. How do i trigger the emoji keyboard by default?

I know there is a way to get all keyboards but i am not sure how to select one by default.

NSArray *array = [[NSUserDefaults standardUserDefaults] objectForKey:@"AppleKeyboards"];
NSLog(@"Keyboards: %@", array);
The output of all the installed international keyboards looks as follows:

Keyboards: (
    "en_US@hw=US;sw=QWERTY",
    "zh_Hant-HWR@sw=HWR",
    "emoji@sw=Emoji"
)

I am supporting only iOS 9.0, so i am ok with assuming the user has an emoji keyboard.

meow
  • 27,476
  • 33
  • 116
  • 177
  • Is this possible in iOS 13, or Is there any chance from this answer https://stackoverflow.com/questions/58168017/showing-the-system-emoji-keyboard-by-default-on-ios-13 – Bishow Gurung Sep 18 '20 at 07:17

2 Answers2

2

It can be done by sub-classing UITextField and return the proper mode value for textInputMode.

See this answer: change the keyboard layout to emoji

LGP
  • 4,135
  • 1
  • 22
  • 34
0

it seems that you cannot do this, iOS does not provide any public api to programatically switch to another input method, and emoji keyboard is regarded as a kind of input method.