Search code examples
ioskeyboardios9emoji

Show Emoji keyboard programatically in iOS 9.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.


Solution

  • 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.