Troubleshooting Push Notifications

Check push notification status and fix common issues.

View as Markdown

If push notifications aren’t working as expected, you can check the notification status to diagnose the issue.

Push Notifications Not Working

If push notifications are not being received:

  • Verify that user notifications are enabled. See Enable User Notifications.
  • Check that APNs (iOS) and FCM (Android) are properly configured.
  • Ensure the app has notification permissions. On Android 13 (API 33) and above, notifications require a runtime permission prompt.
  • For iOS, enable the Push Notifications capability in the exported Xcode project.
  • For Android, ensure google-services.json is added to the Assets directory so the plugin can process it during the build.

Checking Push Notification Status

If push notifications aren’t working as expected, use the GetNotificationStatus coroutine to check the notification status and diagnose the issue.

StartCoroutine(Airship.Shared.push.GetNotificationStatus((PushNotificationStatus status) => {
    Debug.Log("User notifications enabled: " + status.isUserNotificationsEnabled);
    Debug.Log("System notifications allowed: " + status.areNotificationsAllowed);
    Debug.Log("Push privacy feature enabled: " + status.isPushPrivacyFeatureEnabled);
    Debug.Log("Push token registered: " + status.isPushTokenRegistered);
    Debug.Log("User opted in: " + status.isUserOptedIn);
    Debug.Log("Fully opted in: " + status.isOptedIn);
}));

You can also listen for status changes with the OnNotificationStatusChanged event.

Airship.Shared.OnNotificationStatusChanged += (PushNotificationStatus status) => {
    Debug.Log("Notification status changed. Is opted in: " + status.isOptedIn);
};

Common Status Scenarios

  • isUserOptedIn = false: Check whether user notifications are enabled and whether the user granted permission.
  • isPushPrivacyFeatureEnabled = false: Push is disabled in the Privacy Manager.
  • isPushTokenRegistered = false: The device hasn’t received a push token yet. Check network connectivity and platform configuration.
  • isUserOptedIn = true but isOptedIn = false: Push token registration is pending or failed. Check the console logs for errors.