# Install On-call on your iPhone

Install the On-call app from TestFlight, pair it with the console by QR code, and make a test call, so alerts ring your iPhone.

The On-call app is distributed through Apple's TestFlight while it is in testing. Each new
version reaches you through TestFlight; you do not need a Mac, a cable or Xcode. What the app does
when it rings is in [How on-call works](how-on-call-works.md).

## Prerequisites

- An iPhone with iOS 17 or later.
- An invitation to the app's TestFlight testers. Your administrator adds you with the email address
  of your Apple Account; you then get an email from TestFlight. If the **Pair device** dialog in
  the console shows **Open in TestFlight**, that link takes you there too.
- Permission for `monitoring:CreateOnCallPairing` and `monitoring:TestOnCallDevice`,
  `monitoring:DescribeOnCallPages` to open **On-call** in the console, and
  `monitoring:DescribeOnCallDevices` for its **Devices** tab.

## Install the app

1. On the iPhone, install TestFlight from the App Store.
2. Open the invitation email on the iPhone and accept it, or open the link from the console. The
   TestFlight app opens and shows On-call.
3. Install On-call from TestFlight.

TestFlight offers each new version of the app. To get them without asking, turn on automatic
updates for On-call in TestFlight. A TestFlight version runs for 90 days; a newer one replaces it
before then.

## Pair the phone

**Console**
1. Open **Monitoring**, then **On-call**, then **Devices**, and choose **Pair device**.
2. On the iPhone, open On-call and scan the QR code, or scan it with the Camera app. The code works
   once, for ten minutes.
3. Allow notifications when the app asks. The dialog in the console says **Device paired**, and the
   phone is listed under **Devices**.

**CLI**
```sh
dcloud monitoring oncall-pairings create
```

The answer's `qrPayload` is what the QR code encodes; show it as a QR code to the phone, for
example with `qrencode -t ansiutf8`.

**API**
```sh
curl -X POST Deutsche Cloud Console/monitoring/api/oncall/pairings \
  -H "Authorization: EWS-ACCESS-KEY $KEY_ID:$SECRET"
```

## Make a test call

**Console**
1. In **Devices**, open the actions of your phone and choose **Test call**.
2. The phone rings with the system call screen, also in silent mode. Answer it: the app reads the
   test alert aloud.

**CLI**
```sh
dcloud monitoring oncall-devices test device-id
```

Replace device-id with the id of your phone from `dcloud monitoring oncall-devices list`.

**API**
```sh
curl -X POST Deutsche Cloud Console/monitoring/api/oncall/devices/$DEVICE_ID/test \
  -H "Authorization: EWS-ACCESS-KEY $KEY_ID:$SECRET"
```

The test page is listed under **Pages**, with what Apple answered for each push. If the phone does
not ring, open the device in **Devices**: **Rings as** says whether it can ring as a call or only as
a notification.

## Related

- [Set up on-call calls to your iPhone](set-up-on-call.md): targets, and pointing alerts at them
- [How on-call works](how-on-call-works.md)
