# 5.扩展能力

## 5.1 打开活动页面

#### Android

```java
com.vigame.Activity.open();
```

#### iOS

```objectivec
[IOSLoader openActivityPage];
```

#### Unity

```csharp
Wb.CoreManager.Instance.OpenActivityPage();
```

## 5.2 打开公告

#### Android

```java
Notice.open();
```

#### iOS

```objectivec
[IOSLoader openNoticePage];
```

#### Unity

```csharp
Wb.CoreManager.Instance.OpenActivityNotice();
```

## 5.3 提交排行数据

#### Android

```java
Rank.submit(level,score,usedCoins,leftCoins);//提交排行数据
```

#### iOS

```objectivec
 [IOSLoader submitRankInfoWithUserId:@"userId" level:level score:score usedCoins:usedCoins leftCoins:leftCoins];
```

#### Unity

```csharp
Wb.CoreManager.Instance.SumbitRankData(string userId, int level, int score, int usedCoins, int leftCoins);
```

参数：

* userId：用户id
* level：关卡ID
* score：分数
* usedCoins：已用钻石数
* leftCoins：剩余钻石数

## 5.4 打开排行榜

#### Android

```java
Rank.open();
```

#### iOS

```objectivec
[IOSLoader openRank];
```

#### Unity

```csharp
Wb.CoreManager.Instance.OpenRank();
```

## 5.5 打开用户反馈

#### Android

```java
Feedback.open();
```

#### iOS

```objectivec
[IOSLoader openGM];
```

#### Unity

```csharp
Wb.CoreManager.Instance.OpenFeedback();
```

## 5.6 打开隐私政策

#### Android

```java
CoreManagerNative.openProtocolByWeb();
```

#### iOS

```objectivec
[IOSLoader openPrivacyPolicy];
```

#### Unity

```csharp
Wb.CoreManager.Instance.OpenPrivacyPolicy();
```

注：隐私政策中的公司名称可通过assets/VigameConfig.xml中的CompanyIndex修改

## 5.7 打开用户协议

#### Android

```java
CoreManagerNative.openUserAgreementByWeb();
```

**iOS**

```objectivec
[IOSLoader openUserAgreement];
```

#### Unity

```csharp
Wb.CoreManager.Instance.OpenUserAgreementByWeb();
```

## 5.8 使用兑换码

### 5.8.1 是否支持兑换码

#### Android

```java
CDKey.isSupport();
```

#### iOS

```objectivec
[IOSLoader isSupportExchangeCode];
```

#### Unity

```csharp
Wb.CoreManager.Instance.CDKeyIsSupport()
```

返回值：

true：支持

false：不支持

### 5.8.2 使用兑换码

#### Android

```java
CDKey.use(String dhm);
```

```java
CDKey.use(String dhm,DhmCallback callback);
```

示例：

```java
String dhm = "111111";
CDKey.use(dhm,new CDKey.DhmCallback() {

    @Override
    public void onFinish(CDKey.DhmData data) {
        // TODO Auto-generated method stub
        showToast(data.message);
    }
});
```

参数：

* dhm：兑换码
* callback：兑换码兑换结果回调

#### iOS

```objectivec
//使用兑换码[IOSLoader userExchangeCode:@“code”];
```

参数：

* code：兑换码

#### Unity

```csharp
Wb.CoreManager.Instance.UseCDKey(string dhm)
```

参数：

* dhm：兑换码

## 5.9 本地推送（仅限iOS）

#### iOS

```objectivec
 [IOSLoader pushLocalNotification:@“alertBody” fireDate:@“fireDate” noticeId:@”noticeId“];//取消单次推送[IOSLoader cancelPushWithId:@”noticeId“];//取消所有推送[IOSLoader cancelAllPush];
```

参数：

* alertBody：推送内容
* fireDate：触发时间
* noticeId：推送id（用于取消推送）

#### Unity

```csharp
Wb.CoreManager.Instance.NotifyNotification(int id, string body, long fireDate, int unitInterval,Dictionary<string, string> userinfo);
```

参数：

* id：推送id（用于取消推送）
* body：推送内容
* fireDate：触发时间
* unitInterval：间隔时间
* userinfo：用户信息

## 5.10 快速评分（仅限iOS）

#### iOS

```objectivec
//快速打分
[IOSLoader fastmark]
```

## 5.11 跳转评论（仅限iOS）

#### iOS

```objectivec
//跳转评论
[IOSLoader jumpComment];
```


---

# Agent Instructions: 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/cn/ke-hu-duan-jie-ru/ye-wu-jie-kou/5.-kuo-zhan-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.
