How to disable the filtering of emoji characters

In Unity 5.3.4 p1 release notes I see this:
iOS: Added a compile flag in the trampoline code in order to allow the user to disable the filtering of emoji characters.

How exactly I can add this compile flag, and what is this flag?

hi :slight_smile:

In the generated Xcode project you can go into /Classes/UI/Keyboard.mm and change the define for FILTER_EMOJIS_IOS_KEYBOARD. Setting this flag to 0 will allow emoji symbols to be entered using the keyboard.

Hi Ryan, Do you know if there a way to do this via the Xcode Manipulation API in a Post process?

Hey,

You can try defining a preprocessor symbol for the Xcode project, similar to what is described here: http://stackoverflow.com/questions/367368/how-to-define-a-preprocessor-symbol-in-xcode

A script like the following should work:

using UnityEditor;
using UnityEditor.Callbacks;
using System.Collections;
using UnityEditor.iOS.Xcode;
using System.IO;

public class XcodePostProcessSteps {


    // A post process step to modify the generated Xcode project, disabling the emoji filter
    [PostProcessBuild]
    public static void DisableEmojiFilter(BuildTarget buildTarget, string pathToBuiltProject) {

        // Only continue if we're building for iOS
        if (buildTarget == BuildTarget.iOS) {

            // Get Xcode project
            string pbxprojPath = pathToBuiltProject + "/Unity-iPhone.xcodeproj/project.pbxproj";
            PBXProject proj = new PBXProject();
            proj.ReadFromString(File.ReadAllText(pbxprojPath));

            // Set GCC_PREPROCESSOR_DEFINITIONS to define FILTER_EMOJIS_IOS_KEYBOARD=0
            string target = proj.TargetGuidByName("Unity-iPhone");
            proj.SetBuildProperty(target, "GCC_PREPROCESSOR_DEFINITIONS", "FILTER_EMOJIS_IOS_KEYBOARD=0");

            // Write changes to the Xcode project
            File.WriteAllText(pbxprojPath, proj.WriteToString());

        }
    }
}

I hope this helps! :slight_smile:

Thank you so much!! Will give it a shot.

Hi every one,
sorry for popup this old post. Now I"m facing a similar problem, we have the same emoji problem but what we want is disable user to input it from input field. On iOS device we did already but on the android side, we have no idea to deal with it. Please guide me, any help will be appreciate :((
Thanks, Vince

Any update on that? How to disable the emoji keyboard on android?