How to enable emoji on iPhone (programatically)

Emoji is the Japanese term for the picture characters or emoticons used in Japanese wireless messages and webpages. Originally meaning pictograph, the word literally means e “picture” + moji “letter”. The characters are used much like emoticons elsewhere, but a wider range is provided, and the icons are standardized and built into the handsets. The three main Japanese operators, NTT DoCoMo, au and SoftBank Mobile (formerly Vodafone), have each defined their own variants of emoji.

image

Ok enough of this….Lets see how to enable this keyboard to be used everywhere. (By default this keyboard is only works on iPhones from Japan)

Step1:

- (void)enableEmoji {
#define kPreferencesFilePath @"/private/var/mobile/Library/Preferences/com.apple.Preferences.plist"
#define kEmojiKey @"KeyboardEmojiEverywhere"
    NSMutableDictionary *dict = [NSMutableDictionary dictionaryWithContentsOfFile:kPreferencesFilePath];
    if (!dict) return;
    // Toggle the setting from on to off or vice versa
    BOOL isSet = [[dict objectForKey:kEmojiKey] boolValue];
    if (!isSet) {
        [dict setObject:[NSNumber numberWithBool:YES] forKey:kEmojiKey];
        [dict writeToFile:kPreferencesFilePath atomically:NO];
    }
}

Note: This code does not work on iPhone Simulators, Works only on devices.

Step2: After running this code for once, go into “Settings” > “General” > “Keyboard” > “Japanese Keyboard”. Enable the “Emoji” keyboard.

Step3: Open any Notes.app & see the magic.

Note: According to Apple Forums its a private API, then how does applications on appStore are allowed to use it?