Hello @S, Selvaraj there isn't a direct equivalent in Azure Notification Hubs for iOS that provides the same level of detail about invalid device tokens as the GetNotificationOutcomeDetailsAsync
function does for Android's ExpiredChannel
or BadChannel
errors. However, there are ways to identify potentially invalid iOS device tokens:
1. Azure Notification Hub Data Metrics:
APNS Status Codes:
- While you won't see specific error messages like "ExpiredChannel" or "BadChannel," Azure Notification Hub data metrics offer insights through APNS Status Codes. Look for the following codes to understand potential token issues:
- Status Code 8: Indicates an invalid device token.
- Status Code 34: Suggests a problem with the device token format.
- Delivery Failures: Monitor the "Delivery Failures" metric for iOS notifications. A significant increase in failures over a period might indicate a problem with a subset of device tokens.
2. Client-Side Library Error Handling: When using Azure Notification Hub client libraries for iOS, implement proper exception handling for push notification delivery attempts. Libraries might throw specific exceptions for invalid tokens, such as APNServerError
with an underlying code of 8 (indicating an invalid token).
3. App-Level Token Refresh: Consider implementing a mechanism within your iOS app to periodically refresh device tokens. This could involve requesting a new token from Apple Push Notification service (APNs) on app launch or at specific intervals. This helps ensure you have a valid token for future notifications.