( device: DeviceInfo, bundleId: string, payload: Record<string, unknown>, )
| 526 | } |
| 527 | |
| 528 | export 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 | |
| 545 | export async function setIosSetting( |
| 546 | device: DeviceInfo, |
no test coverage detected