Objective-C to Javascript method not working in ios16

Hi
I am trying to send message from Objective-C to Javascript but it seems that my Objective-C to Javascript Reflection is not working for IOS16 (XCODE14 , cocos creator 2.4.7).
The same project is working IOS 14.5 and I am able to see the logs as well.
The problem I understood is bridging header is not working for OS16
I am receiving logs for Javascript to Objective-C methods but vice versa is not working on IOS 16
This is how I am implementing it.

cocos2d::Application::getInstance()->getScheduler()->performFunctionInCocosThread(={
se::ScriptEngine::getInstance()->evalString( passValue, -1 );

Since everything is working fine on IOS 14.5 so I doubt there is any issue with the implementation, Am I missing something here
Attaching the sample project that I build to test this particular case (in this if you run this project the simulator on 14.5 will work you can see by pressing the button the label of button will update but nothing will happen in ios16)
TestBridge.zip (3.3 MB)

Ok Found the solution ,
there is problem with scheduler which is not working for ios16
instead of calling
cocos2d::Application::getInstance()->getScheduler()->performFunctionInCocosThread(={
se::ScriptEngine::getInstance()->evalString( “mymethod” );
});

called directly -
se::ScriptEngine::getInstance()->evalString( “mymethod” );

1 Like