fixing error Warning: TypeError: _reactNative.BackHandler.removeEventListener is not a function (it is undefined)
Description
The change has been done to fix the error: "Warning: TypeError: _reactNative.BackHandler.removeEventListener is not a function (it is undefined)" that is happening using react native version 0.77.2.
Added also a new commit to avoid the error "Attempt to invoke virtual method 'void com.facebook.react.uimanager.UlManagerModule.onBatchComplete()' on a null object reference" In the commit I added a guard to avoid null pointer exception. There is no replacement for onBatchComplete in TurboModules/Fabric. The correct approach is to let React Native handle UI batching, and only call onBatchComplete if UIManagerModule is available (legacy mode).
Changelog
The 1st change is in the file react-native-ui-lib/lib/components/Keyboard/KeyboardInput/KeyboardAccessoryView.tsx and is related to the BackHandler.removeEventListener that should now be handled in a different way with new version of react native. The 2nd change is in the file react-native-ui-lib/lib/android/src/main/java/com/wix/reactnativeuilib/keyboardinput/utils/RuntimeUtils.java and is the guard to avoid the null pointer exception
Please note that for the 2nd issue, as stated in https://github.com/wix/react-native-ui-lib/issues/3594, also the uilib-native dependency should be patched to completely solve the problem.