diff --git a/extension-appsflyer/src/AppsFlyerAttribution.m b/extension-appsflyer/src/AppsFlyerAttribution.m index 2679cc9..54047ca 100644 --- a/extension-appsflyer/src/AppsFlyerAttribution.m +++ b/extension-appsflyer/src/AppsFlyerAttribution.m @@ -77,4 +77,4 @@ - (void) receiveBridgeReadyNotification:(NSNotification *) notification } } @end -#endif // platform \ No newline at end of file +#endif // platform diff --git a/extension-appsflyer/src/AppsflyerAppDelegate.mm b/extension-appsflyer/src/AppsflyerAppDelegate.mm index affb28a..a501b2c 100644 --- a/extension-appsflyer/src/AppsflyerAppDelegate.mm +++ b/extension-appsflyer/src/AppsflyerAppDelegate.mm @@ -30,4 +30,5 @@ - (BOOL)application:(UIApplication *)application openURL:(NSURL *)url @end -#endif // platform \ No newline at end of file +#endif // platform + \ No newline at end of file diff --git a/extension-appsflyer/src/appsflyer_callback.cpp b/extension-appsflyer/src/appsflyer_callback.cpp index 8314c99..b36d62f 100644 --- a/extension-appsflyer/src/appsflyer_callback.cpp +++ b/extension-appsflyer/src/appsflyer_callback.cpp @@ -26,18 +26,21 @@ static void InvokeCallback(MessageId type, const char* json) dmLogError("Appsflyer callback is invalid. Set new callback using `appsflyer.set_callback()` function."); return; } + lua_State* L = dmScript::GetCallbackLuaContext(m_luaCallback); int top = lua_gettop(L); + if (!dmScript::SetupCallback(m_luaCallback)) { return; } - + dmScript::JsonToLua(L, json, strlen(json)); // throws lua error if it fails int ret = dmScript::PCall(L, 3, 0); (void)ret; dmScript::TeardownCallback(m_luaCallback); + assert(top == lua_gettop(L)); }