安卓
// 不带参数
jsb.reflection.callStaticMethod("org/cocos2dx/cpp/AppActivity", "openTsjy", "()V");
// 一个参数
jsb.reflection.callStaticMethod("org/cocos2dx/cpp/AppActivity", "openTxsm", "(Ljava/lang/String;)V", “aaaaaaa”);
AppActivity.java
public static void openTsjy()
{
}
public static void openTxsm(String str)
{
}
ios
jsb.reflection.callStaticMethod("MitiProtocol", "openTsjy");
// 一个参数 ,记得 冒号
jsb.reflection.callStaticMethod("MitiProtocol", "openTxsm:", “aaaaa”);
#import <Foundation/Foundation.h>
NS_ASSUME_NONNULL_BEGIN
@interface MitiProtocol : NSObject
+ (void)openYhxy;
+ (void)openWx;
+ (void)openTxsm:(NSString*)url;
+ (void)openTsjy;
@end
NS_ASSUME_NONNULL_END
#import "MitiProtocol.h"
#import "vigame_core.h"
#import "vigame_social.h"
@implementation MitiProtocol
+ (void)openYhxy
{
vigame::UserAgreement::openByWeb();
}
+ (void)openWx
{
}
// 提现说明
+ (void)openTxsm:(NSString*)url
{
}
// 投诉建议
+ (void)openTsjy
{
}
@end