Skip to main content

Test APNs push notifications

After completing the APNs integration steps, you can test whether push notifications are working.

Prepare the test app

Installation MethodDistribution TypeProfile TypePush to APNs SandboxPush to APNs Production
Xcode run (Simulator)////
Xcode run (Device)/DevelopmentSupported — must use the Nexconn app development environment App Key and APNs configuration.Not supported
IPA fileDevelopmentDevelopmentSupported — must use the Nexconn development environment App Key and APNs configuration.Not supported
Third-party app platform (e.g., pgyer)Ad HocAd Hoc distributionNot supportedRecommended — use the Nexconn app production environment App Key and APNs configuration.
Third-party app platform (e.g., pgyer)EnterpriseEnterprise distributionNot supportedRecommended — use the Nexconn app production environment App Key and APNs configuration.
TestFlightApp Store ConnectApp Store distributionNot supportedSupported — must use the Nexconn app production environment APNs configuration.
App StoreApp Store ConnectApp Store distributionNot supportedSupported — must use the Nexconn app production environment App Key and APNs configuration.

Set up the push test environment

Nexconn apps have separate development and production environments, each with a different App Key. The Nexconn server can send push requests to APNs in various combinations.

Prerequisites:

  • Use a physical device: Simulators cannot receive remote push notifications.
  • Use a non-jailbroken device: Jailbroken devices may not receive remote push notifications.
  • Confirm the Bundle ID contains no wildcards: Apps using a wildcard Bundle ID cannot use remote push notifications.

Build guidance:

  • When running on a device via Xcode: Use the development environment App Key. In the development environment, the Nexconn server pushes only to the APNs Sandbox environment when using P8 or P12 certificates. If using a P12 universal certificate, configure it to push to the APNs Sandbox environment.

  • When building with the Development method: Use the development environment App Key. In the development environment, the Nexconn server pushes only to the APNs Sandbox environment when using P8 or P12 certificates. If using a P12 universal certificate, configure it to push to the APNs Sandbox environment.

  • When building with Ad Hoc / TestFlight / App Store: Use the production environment App Key (requires applying for production in the Nexconn console). With a production environment App Key, the Nexconn server pushes only to the APNs Production environment.

    Exception: In the Nexconn app's development environment, if you use a P12 universal certificate, you may configure it to push to the APNs Production environment to satisfy testing requirements.

For questions, refer to the Xcode documentation:

Test push notification reception

Start with a simple direct chat scenario to test push notifications:

  1. After the app connects to Nexconn successfully, kill the app process.
  2. Send a direct chat message to the current app user.
  3. Check whether the device receives the push notification.

Troubleshooting

If you do not receive push notifications, check the following:

  • If the client called logout when disconnecting, the session is fully deregistered on the Nexconn server. The Nexconn server records only offline messages but does not trigger push notifications.
  • If the app user is already online on Web or PC, Nexconn considers the user online and does not send push notifications to mobile devices by default. If needed, adjust Send to mobiles when web/PC online under Chat > Chat settings > Offline Push on the Chat settings page in the console.
  • If the app user is logged in on multiple mobile devices, the Nexconn server sends push notifications only to the most recently logged-in device.

Use the "Polaris" tool in the console to view message send and receive status, as well as specific push errors:

  1. Go to the "Polaris" Message Flow page in the console, switch to the correct environment (Development / Production), enter your search criteria, and click Query.

  2. In the results, find the message you want to troubleshoot and click View in the "Receive Status" column.

  3. Under Target User Message Receive Status, confirm the message was delivered to the recipient via push. If there is an issue, this page displays the specific reason.

  4. Based on the errors listed below, verify that you have integrated APNs correctly:

    Common Push Error CodeCauseSolution
    P16The message is not a Nexconn built-in type (see Message Type Overview) and lacks a push notification body (pushContent), so it cannot be pushed.For custom message types that require push support, set pushContent when sending the message.
    P17The recipient has enabled global Do Not Disturb.Check whether the relevant feature is configured. See Global Do Not Disturb.
    P19The recipient has enabled Do Not Disturb for a specific Channel.Check whether the relevant feature is configured. See Do Not Disturb Overview or Super Group Do Not Disturb Overview.
    P23deviceId is empty.Set the deviceToken. Verify that all integration steps are complete. See Set deviceToken in Integrate APNs Remote Push Notifications.
    P60Encrypted message not pushed.N/A
    PUSH_I9Certificate loading error.Check whether the correct push certificate is uploaded in the Nexconn console. Verify that all integration steps are complete. See Integrate APNs Remote Push Notifications. If the certificate is confirmed correct, contact Nexconn support.
    Rong_DeviceToken_InvalidThe uploaded deviceToken is invalid.Set the deviceToken. Verify that all integration steps are complete. See Set deviceToken in Integrate APNs Remote Push Notifications.
    APNS_4_4_nullCertificate expired.Check whether the push certificate has expired. If it has, re-upload it to the Nexconn console. If the certificate is confirmed not expired, contact Nexconn support.
    APNS_A2_2400{"reason":"BadDeviceToken"}Incorrect build environment.Verify that the certificate type, configuration, and provisioning profile you uploaded to the Nexconn console all match.
    PUSH_IP8_ERRIncorrect build environment.Verify that the certificate type, configuration, and provisioning profile you uploaded to the Nexconn console all match.
    APNs_XXXPush failed after delivery to Apple; XXX is the APNs error code.Refer to the APNs error code descriptions in the Apple developer documentation Communicating with APNs.

    You can look up all push error codes returned by the Polaris Message Flow tool in the knowledge base: Push Error Codes.

  5. If the issue persists, submit a ticket with your message ID and query results.