Apple Push Notification Service (APNs) Setup Guide
Configure Apple Push Notification Service certificates and provisioning profiles to enable push notification delivery and uninstall tracking for iOS apps using Singular SDK.
Overview
Prerequisites
Enable APNs push notifications by creating SSL certificates and provisioning profiles in Apple Developer Member Center.
Required Components:
- SSL Certificate: Associated with App ID configured for Push Notifications
- Provisioning Profile: Authorizes devices to run app during development and testing
- Apple Developer Account: Active membership required for certificate creation
- Mac Computer: Required for Keychain Access and certificate generation
Apple Developer Portal: All certificate and profile management occurs in the Apple Developer Member Center. Ensure you have appropriate permissions in your organization's developer team.
Certificate Types
Apple provides two types of APNs SSL certificates for different environments.
| Certificate Type | Environment | Use Case |
|---|---|---|
| Development SSL Certificate | Sandbox | Internal testing and development builds |
| Production SSL Certificate | Production | App Store releases and TestFlight builds |
Environment Matching Critical: Apps must use certificates matching their build environment. Production apps with development certificates will fail to receive push notifications.
Step 1: Generate Certificate Signing Request
Create a Certificate Signing Request (CSR) file on your Mac to authenticate SSL certificate creation.
Create CSR File
Using Keychain Access
Generate CSR through Keychain Access application on macOS.
- Open Keychain Access: Navigate to Applications → Utilities → Keychain Access, or use Spotlight search (Cmd+Space)
- Access Certificate Assistant: In menu bar, select Keychain Access → Certificate Assistant → Request a Certificate From a Certificate Authority...
-
Enter User Information:
- User Email Address: Enter your email address (used in Apple Developer account)
- Common Name: Enter descriptive name (e.g., "YourCompany APNs Certificate")
- CA Email Address: Leave blank
- Select Request Type: Choose "Saved to disk" option (required for manual certificate creation)
- Save CSR File: Click Continue and save the .certSigningRequest file to a memorable location on your Mac
Private Key Storage: Keychain Access automatically generates and stores a private key when creating the CSR. This private key pairs with the SSL certificate you'll download from Apple later.
Step 2: Create or Configure App ID
Create a new App ID or configure existing App ID to enable Push Notification capability.
Understanding App IDs
App ID Structure
An App ID uniquely identifies your iOS application and must be an explicit identifier (not wildcard) to support Push Notifications.
Format: Reverse domain notation (e.g.,
com.yourcompany.appname)
Explicit App ID Required: Wildcard App IDs (containing *) cannot use Push Notifications. If you have an existing wildcard App ID, create a new explicit App ID for push-enabled apps.
Create New App ID
App ID Configuration Steps
Create a new App ID in Apple Developer portal with Push Notifications enabled.
- Access Developer Portal: Navigate to Apple Developer Member Center and sign in
- Open Certificates & Identifiers: Select "Certificates, Identifiers & Profiles"
- Navigate to Identifiers: In left sidebar, choose "Identifiers"
- Select Platform: In top-left dropdown, select "iOS Apps" (or "iOS, tvOS, watchOS" in newer interface)
- Create Identifier: Click the "+" button to create new App ID
Configure App ID Details
Fill in App ID information and enable Push Notifications capability.
- Select Type: Choose "App IDs" (not App Clips)
- Select Bundle Type: Choose "App" as the type
- Enter Description: Provide meaningful name (e.g., "YourApp Production")
- Set Bundle ID: In App ID Prefix section, use default Team ID
-
Enter Explicit Bundle ID: In Bundle ID field, enter
your app's identifier exactly as it appears in Xcode (e.g.,
com.yourcompany.appname)
Bundle ID Matching: The Bundle ID value must exactly
match the identifier in your app's Info.plist file and
Xcode project settings. Case sensitivity matters.
Enable Push Notifications
Activate Push Notifications capability in App Services section.
- Scroll to Capabilities: Locate "App Services" section
- Enable Push Notifications: Check the "Push Notifications" checkbox
- Review Configuration: Click Continue and verify settings
- Confirm App ID: Verify the Identifier shows your Bundle ID correctly
- Check Status: Confirm Push Notifications shows as "Configurable"
- Register App ID: Click Submit to create the App ID
Step 3: Configure Push Notification Certificate
Generate SSL certificates for Push Notifications to enable APNs communication with your app.
Access App ID Settings
Edit App ID Configuration
Open App ID settings to create SSL certificates for development and production environments.
- Navigate to Identifiers: In Apple Developer portal, go to Certificates, Identifiers & Profiles → Identifiers
- Select App ID: Click on the App ID you created or want to configure
- Edit Configuration: Click "Edit" button (or App ID opens directly in edit mode)
- Locate Push Notifications: Scroll to "Push Notifications" section in capabilities list
Create Development SSL Certificate
Generate Development Certificate
Create development certificate for testing push notifications during development.
- Start Certificate Creation: In Push Notifications section, click "Create Certificate..." under Development SSL Certificate
- Review Instructions: Read the "About Creating a Certificate Signing Request (CSR)" information
- Continue: Click Continue button
- Upload CSR: Click "Choose File..." and select the .certSigningRequest file you created in Step 1
- Generate: Click Continue (or Generate) to create the certificate
Download and Install Certificate
Download SSL certificate and install it in your Mac Keychain for use with push notifications.
- Download Certificate: Click "Download" button to save .cer file to your Mac
- Complete Process: Click "Done" to close certificate creation flow
- Install Certificate: Locate downloaded .cer file and double-click to add it to Keychain
- Verify Installation: Open Keychain Access and navigate to "My Certificates" category
- Locate Certificate: Find "Apple Development iOS Push Services: your.bundle.id" certificate with associated private key
Certificate Pairing: The downloaded certificate automatically pairs with the private key generated during CSR creation. Both must be present in Keychain for push notifications to work.
Export Certificate as .p12
Generate P12 File
Export certificate and private key as .p12 file for upload to push notification services (like Singular).
- Open Keychain Access: Navigate to "My Certificates" category
- Expand Certificate: Click disclosure triangle next to "Apple Development iOS Push Services" certificate to reveal private key
- Select Both Items: Hold Command key and click to select both certificate and private key
- Export: Right-click selection and choose "Export 2 items..."
- Name File: Save with descriptive name (e.g., "YourApp_Development_APNs.p12")
- Choose Format: Ensure "Personal Information Exchange (.p12)" is selected as file format
- Set Password: Enter strong password to protect the .p12 file
- Confirm Export: Click OK and enter Mac login password if prompted
Security Warning: The .p12 file contains your private key and certificate. Store it securely and never commit it to public repositories. Remember the password—it cannot be recovered.
Create Production SSL Certificate
Production Certificate Generation
Repeat the certificate creation process for Production SSL Certificate required for App Store releases.
- Return to App ID Settings: Navigate back to your App ID configuration in Apple Developer portal
- Production Certificate: In Push Notifications section, click "Create Certificate..." under Production SSL Certificate
- Follow Same Process: Upload CSR, generate certificate, download, and install in Keychain
- Export Production P12: Export as .p12 with descriptive name (e.g., "YourApp_Production_APNs.p12")
- Secure Storage: Store production certificate securely separate from development certificate
Production Certificate Required: Apps submitted to App Store and distributed via TestFlight MUST use Production SSL certificates. Development certificates will fail in production environment.
Step 4: Create Provisioning Profile
Generate provisioning profiles to authorize devices to run your app during development and testing phases.
Understanding Provisioning Profiles
Profile Types
Provisioning profiles link your App ID, certificates, and registered devices to enable app installation and testing.
| Profile Type | Purpose | Device Limit |
|---|---|---|
| iOS App Development | Internal testing on registered devices | Up to 100 devices per profile |
| Ad Hoc | Distribution to testers outside development team | Up to 100 devices per profile |
| App Store | App Store distribution and TestFlight | Unlimited (all devices) |
Create Development Profile
Development Profile Setup
Create iOS App Development provisioning profile for push notification testing.
- Access Provisioning Profiles: In Apple Developer portal, navigate to Certificates, Identifiers & Profiles → Profiles
- Create New Profile: Click "+" button to start profile creation
- Select Type: Choose "iOS App Development" under Development section
- Continue: Click Continue button
- Select App ID: In dropdown menu, choose the App ID configured for Push Notifications
- Continue: Click Continue button
Configure Profile Details
Select certificates, devices, and name the provisioning profile.
- Select Certificate: Check the iOS Development certificate associated with your App ID
- Continue: Click Continue button
- Select Devices: Check all devices where you want to test push notifications (must be pre-registered in Devices section)
- Continue: Click Continue button
- Name Profile: Enter descriptive name (e.g., "YourApp Development Push Testing")
- Generate Profile: Click Generate button
Device Registration: Test devices must be registered in Apple Developer portal before they can be added to provisioning profiles. Register devices by UDID in Devices section.
Install Provisioning Profile
Download and install the provisioning profile for use in Xcode.
- Download Profile: Click Download button to save .mobileprovision file
- Install Profile: Double-click downloaded .mobileprovision file to add it to Xcode
- Verify Installation: Open Xcode → Preferences → Accounts → View Details to confirm profile appears
- Select in Project: In Xcode project settings, select the provisioning profile under Signing & Capabilities
Profile Expiration: Provisioning profiles expire after one year. Renew expired profiles in Apple Developer portal and download new .mobileprovision files.
Verification and Testing
Verify APNs configuration is correct by testing push notification delivery to development devices.
Configuration Checklist
Pre-Testing Verification
Confirm all components are correctly configured before testing push notifications.
- App ID: Explicit App ID with Push Notifications capability enabled
- SSL Certificates: Development and Production certificates created and exported as .p12
- Provisioning Profile: Development profile installed in Xcode with correct App ID and devices
- Bundle ID Match: Xcode project Bundle ID exactly matches App ID identifier
- Capabilities: Push Notifications capability enabled in Xcode Signing & Capabilities
- Keychain: Certificates with private keys present in Mac Keychain "My Certificates"
Testing Push Notifications
Test Procedure
Send test push notification to verify APNs configuration.
- Build and Install: Build app with development provisioning profile and install on test device
- Request Permissions: Launch app and grant push notification permissions when prompted
- Register Device Token: Verify app receives APNs device token in console logs
- Send Test Notification: Use APNs testing tool or push service to send test notification
- Verify Delivery: Confirm notification appears on device
Common Issues
| Issue | Cause | Solution |
|---|---|---|
| No device token received | Push Notifications not enabled in capabilities | Enable Push Notifications in Xcode Signing & Capabilities tab |
| Certificate not found error | Private key missing from Keychain | Re-export certificate including private key from original Mac that created CSR |
| Push notifications not delivered | Wrong environment (dev vs prod) | Verify certificate type matches build configuration |
| Provisioning profile invalid | Profile expired or devices not registered | Renew provisioning profile and ensure devices are registered |
| Bundle ID mismatch | Xcode Bundle ID doesn't match App ID | Update Bundle ID in Xcode to exactly match App ID identifier |
Testing Tools: Use Apple's Push Notification Console in Xcode or third-party tools like Pusher, Knuff, or curl commands to send test notifications during development.
Next Steps
With APNs configured, integrate push notification handling in your app and configure Singular for uninstall tracking.
Integration Guides
Complete Your Setup
- iOS Push Implementation: Implement APNs registration and notification handling in your iOS app code
- Singular SDK Integration: Follow the Singular iOS SDK Implementation Guide to enable uninstall tracking
- Upload Certificate to Singular: Upload your .p12 certificate to Singular's app configuration for uninstall tracking
- Test Uninstall Tracking: Verify uninstall detection works correctly before production release
Production Deployment
App Store Submission Requirements:
- Production Certificate: Use Production SSL certificate for App Store builds
- App Store Profile: Create and use App Store Distribution provisioning profile
- Code Signing: Ensure correct certificate and profile selected in Xcode Archive settings
- TestFlight: TestFlight builds use Production environment—test with Production certificate