Search Unity

iOS 11 Keyboard not appearing

Discussion in 'iOS and tvOS' started by rutkoski, Sep 27, 2017.

  1. rutkoski

    rutkoski

    Joined:
    Jan 9, 2015
    Posts:
    5
    I habe an app that works on iOS 10.3.3, but on iOS 11, when I click an InputField, the field does not get focused and the keyboard does not appear.

    Anyone ele has this problem?

    Compiled on Unity 2017.1.0p4 and Xcode 8.3.3
     
  2. guneyozsan

    guneyozsan

    Joined:
    Feb 1, 2012
    Posts:
    99
    We have the same issue with 2017.1.1f1. No iOS 11 user can go beyond our start screen because they can't focus fields to login.

    If it helps I got this reply from Unity QA:

    Here are some notes from the user in original report:
    - It can be reopened by setting true to TouchScreenKeyboard.active. However it shows only the keyboard buttons without the input field.
    - The input field continues to be hidden until changing the screen orientation again.
    Maybe you would find them useful.


    In my case VR is enabled so default orientation is controlled by Unity. It is set portrait to manually for the 2D login and there maybe a problem while switching from the default orientation to manual.

    You can also find this topic useful:
    http://answers.unity3d.com/questions/1400894/inputfield-not-bringing-up-the-keyboard-on-ios.html
    In the discussion they say that it may be related with this issue:
    https://issuetracker.unity3d.com/is...acebook-sdk-in-portrait-only-autorotate-state
    It says this one is fixed in 2017.1.1p2. I'll be testing it soon.
     
  3. rutkoski

    rutkoski

    Joined:
    Jan 9, 2015
    Posts:
    5
    I'm also building a VR app, and my app is always landscape, haven't tested with portrait.

    I'm installing 2017.1.1p3 and Xcode 9 to test with it again.
     
  4. xuhao

    xuhao

    Joined:
    Apr 2, 2014
    Posts:
    1
    @rutkoski
    You should try to use EventSystem.current.SetSelectedGameObject to force the keyboard show up on the screen.
     
  5. mmsteve

    mmsteve

    Joined:
    Aug 7, 2017
    Posts:
    12
    Hi there,

    I am also receiving the same issue. Did you find a solution for this @rutkoski ?
     
  6. UnityDev291

    UnityDev291

    Joined:
    Jul 21, 2014
    Posts:
    9
    @xuhao unfortunately that didn't work in my testing for iOS 11.1.2 or above with Unity 5.5.5p1.

    I did find a hack to get the keyboard to show (it appears that UnityKeyboard_IsActive() is returning true first time around when no keyboard is active) :

    Open the resulting Xcode project.
    Open the Keyboard.mm class under: Classes -> UI

    Look for the function UnityKeyboard_IsActive() and change as follows (main changes in blue):

    BOOL isKeyboardActive = NO; // add new flag for first time ignore active state
    extern "C" int UnityKeyboard_IsActive()
    {
    // --------------------------------
    // Add the following to return false for first time test
    //

    if( !isKeyboardActive )
    {
    isKeyboardActive = YES;
    return 0;
    }

    // --------------------------------

    return (_keyboard && _keyboard.active) ? 1 : 0;
    }
     
  7. stgs73

    stgs73

    Joined:
    Mar 23, 2015
    Posts:
    59
    Was this ever rolled in as a fix? we think we're experiencing something similar on 2018..but not 100%
     
  8. SistemasIntegralesMx

    SistemasIntegralesMx

    Joined:
    Jul 23, 2018
    Posts:
    1
    How do you open the Keyboard.mm class in Mac?
     
  9. stgs73

    stgs73

    Joined:
    Mar 23, 2015
    Posts:
    59
    Actually we found out indirectly it wa something to do with our diskspace check of all things in objective C, we're gonna look into it more but not calling the standard ( how much space on device ) for iOS resolved the keyboard not coming up :/
     
  10. stgs73

    stgs73

    Joined:
    Mar 23, 2015
    Posts:
    59
    Open the project in xcode and search for Keyboard.mm
     
  11. stgs73

    stgs73

    Joined:
    Mar 23, 2015
    Posts:
    59
    Getting this issue again, it is related to calling objective C code in general, even an empty function - not entirely sure how to get around this without the keyboard.mm hack