MCPcopy Index your code
hub / github.com/callstack/agent-device / handleIosKeyboardCommand

Function handleIosKeyboardCommand

src/core/dispatch.ts:464–506  ·  view source on GitHub ↗
(
  device: DeviceInfo,
  action: KeyboardAction,
  context: DispatchContext | undefined,
  runnerCtx: RunnerContext,
)

Source from the content-addressed store, hash-verified

462}
463
464async function handleIosKeyboardCommand(
465 device: DeviceInfo,
466 action: KeyboardAction,
467 context: DispatchContext | undefined,
468 runnerCtx: RunnerContext,
469): Promise<Record<string, unknown>> {
470 if (action !== 'dismiss' && action !== 'enter' && action !== 'return') {
471 throw new AppError(
472 'UNSUPPORTED_OPERATION',
473 'keyboard status/get is currently supported only on Android; use keyboard dismiss or enter on iOS',
474 );
475 }
476 if (action === 'enter' || action === 'return') {
477 const { runAppleRunnerCommand } =
478 await import('../platforms/apple/core/runner/runner-client.ts');
479 const result = await runAppleRunnerCommand(
480 device,
481 { command: 'keyboardReturn', appBundleId: context?.appBundleId },
482 runnerCtx,
483 );
484 return {
485 platform: 'ios',
486 action: 'enter',
487 visible: result.visible,
488 wasVisible: result.wasVisible,
489 ...successText('Keyboard enter pressed'),
490 };
491 }
492 const { runAppleRunnerCommand } = await import('../platforms/apple/core/runner/runner-client.ts');
493 const result = await runAppleRunnerCommand(
494 device,
495 { command: 'keyboardDismiss', appBundleId: context?.appBundleId },
496 runnerCtx,
497 );
498 return {
499 platform: 'ios',
500 action: 'dismiss',
501 wasVisible: result.wasVisible,
502 dismissed: result.dismissed,
503 visible: result.visible,
504 ...successText(result.dismissed ? 'Keyboard dismissed' : 'Keyboard already hidden'),
505 };
506}
507
508async function handleSettingsCommand(
509 device: DeviceInfo,

Callers 1

handleKeyboardCommandFunction · 0.85

Calls 2

successTextFunction · 0.90
runAppleRunnerCommandFunction · 0.85

Tested by

no test coverage detected