1.Core

1.1 Init SDK(must)

Android

CoreNative.init();

iOS

[IOSLoader startLoaderLibrary];

1.2 Set game exit callback(Only Android)

Android(must)

PayNative.setGameExitCallback(Runnable runnable);

Example:

PayNative.setGameExitCallback(new Runnable() {

    @Override
    public void run() {
        // TODO Auto-generated method stub
        CoreNative.gameExit();//you must execute this code before exit
        currentActivity.finish();
        System.exit(0);
    }
});

Parameters:

  • runnable:the runnable of exit trigger.

1.3 Open exit game(must)

Android

PayNative.openExitGame();

Recommend ways as follows:

if(PayNative.isExitGame()){
    PayNative.openExitGame();
}
else{
    //pop the exit dialog of game
    ...
}

Unity

Wb.PayManager.Instance.OpenExitGame();

Example:

if (Wb.PayManager.Instance.IsSupportExit())
{
    Wb.PayManager.Instance.OpenExitGame();
}
else {
    //pop the exit dialog of game
    showEngineExit();
}

Creator

Wb.Tool.applicationExit();

1.4 Get parameters of Application

Android

import com.google.extra.platform.Utils;

//get the name of Application
Utils.getAppName();
//get package name
Utils.get_package_name();
//get channel
Utils.getChannel();
//get project id
Utils.get_prjid();
//get version of Application
Utils.get_app_ver();
//get imei
Utils.get_imei();

iOS

//get the name of Application
[IOSLoader getAppName];
//get package name
[IOSLoader getPackageName];
//get channel
[IOSLoader getChannel];
//get project id
[IOSLoader getPrjId];
//get version of Application
[IOSLoader getAppVersion];
//get imei
[IOSLoader getImei];

Unity

//get package name
Wb.CoreManager.Instance.GetPackageName();
//get channel
Wb.CoreManager.Instance.GetChannel();
//get project id
Wb.CoreManager.Instance.GetPrjid();
//get version of Application
Wb.CoreManager.Instance.GetVerName();
//get imei
Wb.CoreManager.Instance.GetImei();

Creator

let pname = Wb.Core.getPackageName();//get package name
let prjid = Wb.Core.getPrjid();//get project id
let imsi = Wb.Core.getImsi();//get imsi
let imei = Wb.Core.getImei();//get imei
let lsn = Wb.Core.getLsn();//get lsn
let appid = Wb.Core.getAppid();//get appid
let channel = Wb.Core.getChannel();//get channel
let vername = Wb.Core.getVerName();//get version of Application

1.5 Get custom switch value

Android

ChnlManager.getValueForKey(String customKey);

Example:

//Return: 0-not audit 1-auditing
ChnlManager.getValueForKey("audit");

iOS

+ (NSString *)selfDefineSwitch:(NSString *)customKey;

Example:

[IOSLoader selfDefineSwitch:@"audit"]

Unity

Wb.CoreManager.Instance.GetCustomSwitch(string customKey)

Example:

Wb.CoreManager.Instance.GetCustomSwitch("audit")

Parameters:

  • customKey:custom key name

Return: 0-not audit, 1-auditing

Creator

Wb.Core.getCustomSwitch(customKey:string);

Example:

Wb.Core.getCustomSwitch("audit")

Parameters:

  • customKey:custom key name

Return: 0-not audit, 1-auditing

1.6 Check Signature

Unity

    WbAESLibrary.Signature.CheckSignature(delegate ()
    {
        // successCall();
    }
    , delegate ()
    {
       // failCall();
    });

最后更新于

这有帮助吗?