This article discusses how to diagnose and fix issues related to Secure Mail push notifications on iOS devices.
Push notifications for Secure Mail allow users to receive updates when the app refreshes, and notifications about email and calendar activity through the Apple Push Notification service (APNs) when the app is running in the background or is closed. For example, users can see updates of unread mail counts when the badge on the Secure Mail app icon updates. Push notifications also facilitate the timely delivery of lock screen updates for new messages.
For a deep dive into push notifications on Secure Mail for iOS, see the article Push Notifications for Secure Mail for iOS in the Citrix product documentation.
The Secure Mail logs are always the first piece of information to obtain when dealing with an APNS issue. Ideally, you should ask users to send the logs immediately when an issue occurs. This way, they'll capture the logs corresponding to the error.
In order to generate notifications on the device lock screen, Secure Mail requires that Background App Refresh be enabled. This can be enabled in your iOS settings under Settings à General à Background App Refresh.
Make sure that Background App Refresh is switched on both globally as well as for Secure Mail.
Inside this file, the following XML entities are related to APNs. If any of the required policies for your environment are not set, ensure that you set them to the required value in the XenMobile console.
Entity Name | Description | Required value in order for APNS to function |
---|---|---|
PushNotificationsEWSHostName | The host name of the Exchange Web Services (EWS) endpoint. | This value does not need to be set. If this value is not set, the value of the ExchangeServer entity is used. If you use autodiscovery to provision the account, and this value is not set, the EWS endpoint is resolved during autodiscovery. An empty value here does not indicate a problem or concern. |
PushNotificationsEnabled | Flag indicating whether APNs is enabled | Must be set to true. |
PushNotificationsListenerServiceHostName | URL of the listener service endpoint that is used to generate the push notifications. | Must be set to a valid endpoint URL. The valid endpoints are documented at https://docs.citrix.com/en-us/xenmobile-apps/10/secure-mail/push-notifications.html |
PushNotificationsTenantId | The tenant ID that's used when communicating with the listener service endpoint. | This is only needed when using an enterprise deployment of Secure Mail. For app store Secure Mail deployments, you do not need this value because Secure Mail requests the required tenant ID from the Citrix cloud listener service. |
To troubleshoot these and other push notification-related events, the Secure Mail 10.5.5 release includes a file called CtxLog_APNS_Events.csv.
This file contains information about the following events:The entries contain the following information:
The last three entries allow Citrix to easily find the cloud listener service logs for the device. Those strings line up with entries in the listener service logs, allowing technical support to more quickly find information relevant to any failures.
The log file bundle from Secure Mail includes a file called CTXLog_backgroundFetchSchedule.csv. This file logs background application refresh events, as well as events that indicate a push notification has been delivered to the device.
By using this file, you can get a ballpark figure of when Secure Mail received the last push notification-related wake-up. Note that push notifications are not always delivered to Secure Mail. Examples of when they are not delivered include the following:
When looking at this file, you'll see the following as an example.
BackgroundFetch | 01-Dec-2016 12:47:19:310 (+0000) | 01-Dec-2016 12:47:34:826 (+0000) | 15 | UIBackgroundFetchResultNewData |
Remote Notification | 01-Dec-2016 12:47:41:727 (+0000) | 01-Dec-2016 12:47:44:488 (+0000) | 2 | UIBackgroundFetchResultNewData |
Remote Notification | 01-Dec-2016 12:48:01:026 (+0000) | 01-Dec-2016 12:48:03:345 (+0000) | 2 | UIBackgroundFetchResultNewData |
Remote Notification | 01-Dec-2016 12:51:31:254 (+0000) | 01-Dec-2016 12:51:33:473 (+0000) | 2 | UIBackgroundFetchResultNewData |
Remote Notification | 01-Dec-2016 12:55:41:419 (+0000) | 01-Dec-2016 12:55:44:738 (+0000) | 3 | UIBackgroundFetchResultNewData |
BackgroundFetch | 01-Dec-2016 12:55:41:483 (+0000) | 01-Dec-2016 12:56:09:489 (+0000) | 28 | UIBackgroundFetchResultNewData |
Remote Notification | 01-Dec-2016 13:00:51:084 (+0000) | 01-Dec-2016 13:00:53:511 (+0000) | 2 | UIBackgroundFetchResultNewData |
Remote Notification | 01-Dec-2016 13:02:56:311 (+0000) | 01-Dec-2016 13:02:59:193 (+0000) | 2 | UIBackgroundFetchResultNewData |
BackgroundFetch | 01-Dec-2016 13:02:56:373 (+0000) | 01-Dec-2016 13:03:24:330 (+0000) | 27 | UIBackgroundFetchResultNewData |
Remote Notification | 01-Dec-2016 13:06:16:308 (+0000) | 01-Dec-2016 13:06:18:586 (+0000) | 2 | UIBackgroundFetchResultNewData |
Remote Notification | 01-Dec-2016 13:09:31:460 (+0000) | 01-Dec-2016 13:09:33:480 (+0000) | 2 | UIBackgroundFetchResultNewData |
The columns are as follows:
Note that the Remote Notification text shows that push notifications are being received. You can use this file to give an idea as to when and if the device is receiving push notifications.
Select the "Module" column and choose to display only Secure Mail.APNS.
Only then the logs related to the push notification aspects of Secure Mail appear.
These logs show the following:
From this information, you can look for any errors or warnings that may help narrow down the issue.
This occurs on enterprise distribution builds in which the customer has not enabled the Push notification entitlement on their App ID. You can use the following indication in the logs to ascertained this situation.
Failed to register for remote notifications with error error.domain=NSCocoaErrorDomain, error.code=3000, error.userInfo={ NSLocalizedDescription = no valid 'aps-environment' entitlement string found for application";
In this case, look at your provisioning profile and ensure that that the Push Notifications entitlement is enabled as shown in this figure.
The subscription to APNs notifications may fail completely. You can find out by looking for ERROR category messages related to the subscription to push notifications.
Common failure reasons include.
Some points to note:
Secure Mail periodically checks to see that its subscription to notifications is valid. Secure Mail checks by making a network request to the Citrix cloud listener service. The status may indicate that the subscription is no longer valid. At this point, Secure Mail resubscribes to push notifications.
A subscription will be considered to have become invalid when Exchange Server sends no status updates for a subscription to the Citrix cloud listener service for a period of approximately a half an hour.
You should check on the following.
If the logs reveal authentication failures when registering for push notifications, it's likely that EWS is configured to use a different form of authentication than the way ActiveSync is configured. Ensure that if you are using certificate-based authentication for Secure Mail that EWS is also configured to use certificate-based authentication.
If you are using HTTP Basic authentication for Secure Mail, ensure that NTLM authentication is being used for EWS.
For more information on this topic, please refer to:
Configuring certificate-based authentication with EWS for Secure Mail push notifications
When certificate based authentication is used for EWS authentication, the client may fail to subscribe with the logs indicating HTTP 413 errors. In this case, ensure that the uploadReadAheadSize is configured to an appropriate value on IIS. The uploadReadAheadSize attribute is discussed at https://www.iis.net/configreference/system.webserver/serverruntime. Set this value to be at least the size of the maximum attachment size that is configured for ActiveSync.
If you suspect a problem with the EWS subscription because the subscription has become invalid, you can look at the EWS event logs.
You can open the event logs on a Windows-based computer and then view and search them in the event viewer application. You can use the application to search for the instances of the listener service endpoint URL that you are using. For example, you could search for us-east-1.mailboxlistener.xm.citrix.com.The event logs that you need are the Application Logs from the client access server that hosts the user's mailbox. These logs looks like the following figure. They show the connection failure to the listener service. The event source in this example is MSExchange Web Services.
If you see multiple errors in the EWS events logs related to the Citrix cloud listener service endpoint URL, ensure that your firewall rules allow your Exchange Server to communicate outwards to the Citrix cloud listener service.
As we discuss in this article, you can follow many steps on your own to troubleshoot push notification issues with Secure Mail for iOS. By using both client side and server logs, you can narrow down the root cause of any push notification issues quickly.