Vibration
Trigger different types of vibrations on the user's device.
TTMinis.game.vibrateShort(opts)
Triggers a short vibration on the device (15 ms).
Parameters
Field | Type | Description | Required |
|
| The vibration intensity type. Valid values: | Yes |
|
| The callback function called when the API call succeeds | No |
|
| The callback function called when the API call fails | No |
|
| The callback function called when the API call ends. Called whether the call succeeds or fails. | No |
Example
TTMinis.game.vibrateShort({
type: "medium",
success(res) {
console.log("Short vibration triggered");
},
fail(err) {
console.error(err);
}
});TTMinis.game.vibrateLong(opts)
Triggers a long vibration on the device (400 ms).
Parameters
Field | Type | Description | Required |
|
| The callback function called when the API call succeeds | No |
|
| The callback function called when the API call fails | No |
|
| The callback function called when the API call ends. Called whether the call succeeds or fails. | No |
Example
TTMinis.game.vibrateLong({
success(res) {
console.log("Long vibration triggered");
},
fail(err) {
console.error(err);
}
});