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

Function pushIosNotification

src/platforms/apple/core/apps.ts:528–543  ·  view source on GitHub ↗
(
  device: DeviceInfo,
  bundleId: string,
  payload: Record<string, unknown>,
)

Source from the content-addressed store, hash-verified

526}
527
528export async function pushIosNotification(
529 device: DeviceInfo,
530 bundleId: string,
531 payload: Record<string, unknown>,
532): Promise<void> {
533 requireSimulatorDevice(device, 'push');
534 await ensureBootedSimulator(device);
535 const tempDir = await fs.mkdtemp(path.join(os.tmpdir(), 'agent-device-ios-push-'));
536 const payloadPath = path.join(tempDir, 'payload.apns');
537 try {
538 await fs.writeFile(payloadPath, `${JSON.stringify(payload)}\n`, 'utf8');
539 await runSimctl(device, ['push', device.id, bundleId, payloadPath]);
540 } finally {
541 await fs.rm(tempDir, { recursive: true, force: true });
542 }
543}
544
545export async function setIosSetting(
546 device: DeviceInfo,

Callers 2

index.test.tsFile · 0.90
handlePushCommandFunction · 0.85

Calls 3

requireSimulatorDeviceFunction · 0.90
ensureBootedSimulatorFunction · 0.90
runSimctlFunction · 0.70

Tested by

no test coverage detected