message channel between Native and JS (#3900)

* Invoke Native Function in JS
* Invoke JS function in Native
Co-authored-by: LX <codingboeuf@jizamaoxuewangdeMacBook-Air.local>
This commit is contained in:
timlyeee
2021-09-29 14:16:30 +08:00
committed by GitHub
parent 27e5a5630f
commit 85c52544a5
11 changed files with 578 additions and 93 deletions
@@ -1,6 +1,5 @@
/****************************************************************************
Copyright (c) 2013-2016 Chukong Technologies Inc.
Copyright (c) 2017-2021 Xiamen Yaji Software Co., Ltd.
Copyright (c) 2018-2021 Xiamen Yaji Software Co., Ltd.
http://www.cocos.com
@@ -25,9 +24,15 @@
****************************************************************************/
#pragma once
#include <string>
#include <vector>
#include "platform/java/jni/JniHelper.h"
#include "cocos/bindings/jswrapper/SeApi.h"
namespace se {
class Object;
}
bool register_javascript_java_bridge(se::Object *obj);
bool register_javascript_java_bridge(se::Object *obj); // NOLINT(readability-identifier-naming)
bool register_script_native_bridge(se::Object *obj); // NOLINT(readability-identifier-naming)
void callPlatformStringMethod(const std::string &arg0, const std::string &arg1); // NOLINT(readability-identifier-naming)