the problem is this:
background: our company does mixed app, and I develop some web pages in app.
in mixed app, there will be an Android object in webview, which is a callable object exposed to me by my Android colleagues. Through this object, I can call some Android methods to achieve the purpose of linkage and interaction between the two functions.
requirement: a certain requirement requires me to call the method written by my Android colleague: Android.getUserInfo (), get the userInfo after calling, and then make a judgment.
but this getUserInfo () method is only available in the app package after a certain version (assuming 5.0), so it needs to be compatible with the older version of the app package.
my attempt: I directly wrote a let userInfo = Android.getUserInfo ()? Android.getUserInfo (): "default";
at that time, I thought I had solved the problem, but who knows, the above code was reported wrong because of getUserInfo is not defined, and what is more embarrassing is that the later code is not executed. Burst.
I would like to ask you if there is a way to achieve this compatibility between the two situations.