Skip to main content
When you finish this page, pgw can wake your iOS app for a call. iOS wakes a closed app for a call only through a VoIP push. Apple delivers a VoIP push at once, and the app must answer it by showing the system’s call screen. pgw sends it through Apple’s push service, APNs, signed with a key from your Apple developer account.

Before you begin

  • An Apple developer account with access to Certificates, Identifiers & Profiles.
  • The app’s bundle ID, such as com.example.phone.

Create an APNs key

One key works for all the apps of your team, and it doesn’t expire.
1

Open your developer account

Sign in to your Apple developer account, and open Certificates, Identifiers & Profiles.
2

Create a key

Under Keys, create a key with Apple Push Notifications service (APNs) turned on.
3

Download the key

Download the .p8 file, and note the key ID. You can download the file only once.
4

Note your team ID

Note your team ID, shown under Membership details.
The .p8 file is a credential. Don’t commit it or share it.

Register the iOS app in pgw

Apple runs two separate push services, and a build receives pushes from only one of them. Set --apns-environment to sandbox for a build that you run from Xcode, and to production for TestFlight and App Store builds:

Check that it works

Register the app through pgw, close it, and call the account. The phone shows the system’s incoming-call screen. If it doesn’t, the most common cause is the environment: a debug build with production, or a store build with sandbox. The push log shows Apple’s answer to each push.

Which push pgw sends for each event

An iOS app can give pgw two tokens: a VoIP token, for pushes that ring, and a remote token, for ordinary notifications. The table shows which token pgw uses for each event. To send both from your app, see Name the iOS token kinds. An app that sent no remote token gets only call pushes. A test push never goes to the VoIP token, because iOS requires the app to report a call to CallKit for every VoIP push.

Next steps

Integrate your app

Send the push tokens in the REGISTER and report each call to CallKit.

Push payload

Look up the fields that each push in the table carries.