My application is not receiving push notifications?
If you are using the Validic Push Notification service and you are having issues receiving push notifications, the following may help in troubleshooting the issue:
Checking your application's Push Notification URL
The first step to ensure that your application's Push Notification URL is properly configured. You may do this by making a test POST request to your Push Notification URL, for example:
POST -H 'Content-Type: application/json' { "data": [ { "_id": "51552cd7fded0807c4000017", "activity_type": "fitness", "activity_date": "2013-10-08T19:07:01+00:00", "source": "sample_app" } ] }
Check your error logs if there may be issues. If your application's Push Notification URL is processing notifications correctly, you may contact to confirm if your Push Notification URL has been set correctly.
Checking that your application can receive JSON notifications
Validic Push Notifications are sent using JSON data. It may be possible that your application is having issues parsing the JSON data received. Check and make sure your application is able to receive and read the JSON data being sent.
Please also note that Validic Push Notifications may have multiple notification item updates included. These are encapsulated in a "data" array.
Ensuring your application does not timeout when receiving notifications
It is recommended practice when managing Validic Push Notifications to avoid a data retrieval process when receiving push notifications. To elaborate, consider the following scenario:
Your application receives a push notification
Your application loops through each item in the notification and makes a corresponding GET request to Validic to retrieve the data
Only after looping through each item will your application respond with an HTTP HEAD 204 in response to the push notification
During high volume traffic conditions, each Validic Push Notification may include up to 100 items. By making the second step above of making GET requests to Validic to retrieve the corresponding data, the original request which is sending you the push notification may time out thereby causing an error on your side. Please note that Validic Push Notifications are set to time out within 3000ms.
It is recommended practice is to create a queuing mechanism to temporarily store the push notification you received and have a background process to process and retrieve the data from the Validic API.
Testing using an external service
Another way to test push notifications is by using external services. You may want to check for example Runscope which provides an excellent way to capture and inspect HTTP requests.
Checking SSL certificates
In certain cases, it is possible that your SSL certificate for your domain is valid, but is lacking the intermediate certificate in the chain. Because of this, Validic is unable verify the authenticity of your domain causing notifications being sent to you to fail. In this case, the following resources may be of help your to add the required chain certificates: