Clipboard API
Clipboard API
SetClipboardData(data, onSuccess, onFail)
将文本保存到剪贴板。
参数:
| 参数 | 类型 | 必须 | 说明 |
|---|---|---|---|
data | string | ✅ | 要保存到剪贴板的文本 |
onSuccess | Action<SetClipboardDataResult> | - | 成功回调 |
onFail | Action<string> | - | 失败回调 |
TudadaSDK.Instance.SetClipboardData("邀请码: ABC123",
onSuccess: (result) => Debug.Log("复制完成")
);
GetClipboardData(onSuccess, onFail)
从剪贴板获取文本。
参数:
| 参数 | 类型 | 必须 | 说明 |
|---|---|---|---|
onSuccess | Action<GetClipboardDataResult> | - | 成功回调 |
onFail | Action<string> | - | 失败回调 |
成功响应 (GetClipboardDataResult):
| 字段 | 类型 | 说明 |
|---|---|---|
data | string | 剪贴板文本 |
TudadaSDK.Instance.GetClipboardData(
onSuccess: (result) => Debug.Log("剪贴板: " + result.data)
);