---
title: Testing push notifications on iOS
description: Confirm that PingOne can reach your iOS app through APNs before testing end-to-end push authentication.
component: orchsdks
page_id: orchsdks:davinci:use-cases/pingone-mfa/ios/06c-testing-push-notifications
canonical_url: https://developer.pingidentity.com/orchsdks/davinci/use-cases/pingone-mfa/ios/06c-testing-push-notifications.html
llms_txt: https://developer.pingidentity.com/orchsdks/llms.txt
docs_for_agents: https://developer.pingidentity.com/build-with-ai/docs-for-agents.md
keywords: ["DaVinci", "MFA", "PingOne", "iOS", "Push", "APNs", "Testing", "SDK"]
section_ids:
  getting_the_device_token: Getting the device token
  sending_the_test_push: Sending the test push
---

# Testing push notifications on iOS

[icon: circle-check, set=far]PingOne [icon: apple, set=fab]iOS

Before testing push authentication end to end, confirm that PingOne can reach your app through APNs.

This step needs everything in [Configuring push notifications](06a-push-environment-setup.html) and the token registration code in [Handling push notifications](06b-handling-push-notifications.html) to be in place first: the app must be running on a device with the Push Notifications capability enabled so that the system issues an APNs token, and the app must register that token with PingOne using `setDeviceToken`.

## Getting the device token

The token registration snippet in [Handling push notifications](06b-handling-push-notifications.html) includes a commented-out log statement that prints the token after a successful registration.

Uncomment those lines, run the app on a physical device, and copy the token from the console:

```
Registered. APNs push token: 8f3a1c...
```

Push notifications do not work in the iOS simulator; a device token from a simulator is not usable for real pushes.

If the app was already registered before you completed the APNs configuration, the system might not call the delegate method again on startup. Uninstall and reinstall the app to force a fresh token, or register for remote notifications explicitly at startup:

Registering for remote notifications

```swift
UIApplication.shared.registerForRemoteNotifications()
```

## Sending the test push

The token the app registers depends on the build configuration: a `DEBUG` build registers with the APNs sandbox environment and a release build with production. A test push only arrives when the sending environment matches the token's environment.

To send a test push notification from the PingOne admin console:

1. Log in to your PingOne administration console.

2. In the left panel, navigate to **Applications** > **Applications**.

3. Select the **Native App (OpenID Connect)** application that represents your mobile app, for example **pingone-mfa-ios**.

4. On the **Mobile** tab, click the pencil icon ([icon: pencil, set=far])

   The page displays the date when you uploaded the APNs authentication key:

   ![pingone push notification test ios](../../../_images/pingone-push-notification-test-ios.png)Figure 1. The Mobile tab of a PingOne native application, showing the Test button.

5. Click **Test**.

   PingOne displays the **Test Push Notification** dialog:

   ![pingone push notification test dialog ios](../../../_images/pingone-push-notification-test-dialog-ios.png)Figure 2. The Test Push Notification dialog.

6. In the token field, paste the APNs device token you copied from the console.

7. Click **Send Test**.

The device receives a notification if PingOne can reach the app through APNs:

![pingone dry push notification](../../../_images/pingone-dry-push-notification.png)Figure 3. Test push notification on the paired device.

A successful test confirms that the APNs authentication key is correct and that PingOne can deliver to your app. If the push does not arrive, check that:

* The APNs authentication key, Key ID, and Team ID configured in PingOne come from the same Apple Developer team as the app's signing certificate.

* The test push environment matches the build you are testing: a sandbox token needs a sandbox test push, a production token needs a production test push.

* The device has a network connection and notifications are enabled for the app.
