Hi everybody,
Is there any way to dispatch event from the native code?
I know there’s an example on the documentation. This example use the willLoadMain: delegate to dispatch a runtime event, but, since I am interested on create a plugin to other corona users, I should be able to dispatch this event anywhere inside my code. And, as far as I understand, the CoronaDelegate is used inside the App Project, and I should use just the Plugin Project.
The problem is that I don’t have access to the Corona Runtime, and the lua_State as well. So, I tried to create a new lua_State, and Push the Runtime, but I keep getting the error: “no Runtime to send event to”
Here’s my code:
lua\_State \* L = CoronaLuaNew(); CoronaLuaPushRuntime(L); CoronaLuaNewEvent(L,kEventName); CoronaLuaRuntimeDispatchEvent(L,-1);