Clipboard API
Clipboard API
SetClipboardData(data, onSuccess, onFail)
Saves text to the clipboard.
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
data | string | ✅ | Text to save to clipboard |
onSuccess | Action<SetClipboardDataResult> | - | Success callback |
onFail | Action<string> | - | Failure callback |
TudadaSDK.Instance.SetClipboardData("Invite code: ABC123",
onSuccess: (result) => Debug.Log("Copy complete")
);
GetClipboardData(onSuccess, onFail)
Retrieves text from the clipboard.
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
onSuccess | Action<GetClipboardDataResult> | - | Success callback |
onFail | Action<string> | - | Failure callback |
Success Response (GetClipboardDataResult):
| Field | Type | Description |
|---|---|---|
data | string | Clipboard text |
TudadaSDK.Instance.GetClipboardData(
onSuccess: (result) => Debug.Log("Clipboard: " + result.data)
);