> For the complete documentation index, see [llms.txt](https://tyson.gitbook.io/vigamedoc/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://tyson.gitbook.io/vigamedoc/en/ke-hu-duan-jie-ru/ye-wu-jie-kou-1/1.-ji-chu-neng-li.md).

# 1.Core

## 1.1 Init SDK(must)

### Android

```
CoreNative.init();
```

### iOS

```
[IOSLoader startLoaderLibrary];
```

## 1.2 Set game exit callback（Only Android）

### Android（must）

```java
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

```csharp
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

```csharp
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();
    });
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://tyson.gitbook.io/vigamedoc/en/ke-hu-duan-jie-ru/ye-wu-jie-kou-1/1.-ji-chu-neng-li.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
