Keyboard not showing when focusing a text input within Unity
Hi,
I can refer to this same issue: https://github.com/f111fei/react-native-unity-view/issues/140
The keyboard won't show, but if you trigger a keyboard from within react-native before any unity events, it works.
Does anyone have any ideas what the issue is here? Im guessing its some sort of lifecycle event not firing until react-native triggers a keyboard to open.
Thanks
Hi! Did you encounter this problem in IOS? The situation I encountered in IOS is the same as you. I solved it in the following way. After you start unity, call the following function. I call it through react native
RCT_EXPORT_METHOD(focusInput){
dispatch_async(dispatch_get_main_queue(), ^{
UIWindow* window = [[UIApplication sharedApplication].delegate window];
if (window != nil && window.rootViewController != nil)
{
[window makeKeyAndVisible];
}
});
}
Yeah the problem was for iOS, I didn’t find a fix but just worked around it.
Thanks very much for posting your fix, Il be sure to give that a go!