> ## Documentation Index
> Fetch the complete documentation index at: https://docs.pgw.sipmicro.services/llms.txt
> Use this file to discover all available pages before exploring further.

# Configure apps for pgw

> Register your mobile or browser app in pgw with its push credentials, and choose how pgw delivers calls to it.

Apple and Google deliver a push only when it is signed with the credentials of the app's owner. So before pgw can wake your app, pgw must hold your push credentials, and the app must tell pgw its push token when it registers.

## What you need for each app

| | What it is | Who provides it |
| - | - | - |
| Push credentials | An APNs key for iOS, or a Firebase service account for Android. A browser app needs none, because pgw generates its key. | You, from your Apple or Google developer account |
| An app record in pgw | The app's identifier together with those credentials | You, with `pgw app create` |
| Push support in the app | The app sends its push token in each REGISTER, and registers again when a push wakes it. | The app's developer. See [Integrate your app](https://docs.pgw.sipmicro.services/apps/integrate.md). |

If someone else builds the app, ask them for its bundle ID or package name and the push credentials. pgw needs nothing else from them.

## Register the app in pgw

**1. Get the push credentials**

Follow the page for your platform. Each one gives the `pgw app create` command for that platform:

* [iOS apps](https://docs.pgw.sipmicro.services/apps/ios.md)
* [Android apps](https://docs.pgw.sipmicro.services/apps/android.md)
* [Web apps](https://docs.pgw.sipmicro.services/apps/web.md)

**2. Create the app record**

For Example Corp's iOS app, the command looks like this:

```bash theme={null}
pgw app create --platform ios --bundle-id com.example.phone --apns-team-id ABCDE12345 --apns-key-id ABC123DEFG --apns-key-file AuthKey_ABC123DEFG.p8 --apns-environment sandbox
```

pgw answers with the new record, without the key:

```json theme={null}
{
  "id": "7cHG8I3xYBSfBy8tXDMpPg",
  "platform": "ios",
  "bundle_id": "com.example.phone",
  "apns_team_id": "ABCDE12345",
  "apns_key_id": "ABC123DEFG",
  "apns_environment": "sandbox",
  "delivery_mode": "",
  "managed_refresh_push": "",
  "created_at": "2026-11-15T23:54:52Z"
}
```

Keep the `id`. The other `pgw app` commands take it, and `pgw app list` shows it again.

**3. Add the SIP account in the app**

The account is the user's normal account at the PBX. What you add is the outbound proxy, which sends everything through pgw, with TLS as the transport and push notifications turned on:

| Field | Value |
| - | - |
| Username and password | The user's account at the PBX, such as `1001` |
| Domain | `pbx.example.com` |
| Transport | TLS |
| Outbound proxy | `sip:pgw.example.com:5061;transport=tls` |
| Push notifications | On |

## Check that it works

After the app registers, list the bindings:

```bash theme={null}
pgw binding list
```

The list shows a binding for the account. To check your credentials without placing a call, send the device a silent test push:

```bash theme={null}
pgw binding test-push --binding <binding-key>
```

pgw prints the push service's answer. pgw checks only the format of your credentials when you create the app, so this push is the first time that Apple or Google checks them.

## If it doesn't work

| Symptom | Cause |
| - | - |
| The app's REGISTER gets `555 Push Notification Service Not Supported` | The app named a push provider that pgw doesn't know, or pgw found no app record that matches what the app sent. Compare the bundle ID, or the Firebase project on Android, with `pgw app list`. |
| The binding exists, and the test push shows an error from the push service | Apple or Google refused the credentials. On iOS, also check that `--apns-environment` matches the build: `sandbox` for a debug build, `production` for a store build. |
| The test push gets `409` | The iOS app registered only a VoIP token. pgw never sends a test push to a VoIP token, so call the account instead. |
| No binding appears | The registration didn't succeed. pgw stores a binding only after the PBX accepts the REGISTER, so check the app's registration status first, and then the outbound proxy and that the phone can reach port `5061`. |

For other symptoms, see [Troubleshooting](https://docs.pgw.sipmicro.services/troubleshooting.md).

## Settings for one app

| To | Run |
| - | - |
| Show a readable name in log lines, instead of the bundle ID | `pgw app set-name --id <app-id> --name "Example Phone"` |
| Push for every call, even when the app still has an open connection | `pgw app set-delivery-mode --id <app-id> --mode always_push` |
| Return the delivery mode to the gateway default | `pgw app set-delivery-mode --id <app-id> --mode default` |

See [Call delivery settings](https://docs.pgw.sipmicro.services/concepts.md#call-delivery-settings) for what the delivery mode changes.

## Next steps

> [card] [iOS apps](https://docs.pgw.sipmicro.services/apps/ios.md)
>
> Create the APNs key and register an iOS app.

> [card] [Android apps](https://docs.pgw.sipmicro.services/apps/android.md)
>
> Create the Firebase service account and register an Android app.

> [card] [Integrate your app](https://docs.pgw.sipmicro.services/apps/integrate.md)
>
> Add push support to an app that you build yourself.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.