진동 울리기 | 사용자 경험, 알림, 인터랙션 | Appbox iOS SDK 가이드
진동 울리기
진동으로 알림을 명확하게
AppBox.shared.vibrate(type:vibrationCount:completion:)
Swift
1
AppBox.shared.vibrate(type: "haptic", vibrationCount: 1) { value, error in
2
guard error == nil else { return }
3
print(value)
4
}
1
[AppBox.shared vibrateWithType:@"haptic" vibrationCount:1 completion:^(BOOL value, NSError *error) {
2
if (error) { return; }
3
NSLog(@"%d", value);
4
}];
Request 항목 정의
| Request 항목 | 필수여부 | 설명 | 기본값 |
|---|---|---|---|
type | 필수 | 진동 타입: haptic / short / long | - |
vibrationCount | 필수 | 진동 횟수 | - |
completion | 필수 | 결과를 받는 콜백. 메인 스레드에서 한 번 호출됩니다 | - |
Response 항목 정의
| Response 결과값 | |
|---|---|
| 값 | Bool |
| 오류 | 실패 원인. NSError |
화면 불필요. type으로 진동 종류를 지정합니다
웹 브릿지에서는 진동 울리기의 application.vibrate입니다.