现在需要从OC调用到AppStoreIAPModule.js 中 paymentHandler();
AppStoreIAPModule.js内容如下
var AppStoreIAPModule = {
//…
paymentHandler : function (){}
}
module.export = AppStoreIAPModule
ScriptingCore::getInstance()->evalString(“AppStoreIAPModule.paymentHandler()”);
执行时 报错 AppStoreIAPModule is not defined 请问 是我需要怎样配置或者做法 可以调用这个文件的这个函数?谢谢
cc.find(‘Game’).getComponent(‘AppStoreIAPModule’).paymentHandler();
脚本挂载在一个节点上
我的这个Game是常驻节点
把AppStoreIAPModule对像放在window上
window.AppStoreIAPModule = {
paymentHandler: function() {}
}
2赞
请问你解决objc调用js的问题了吗?