Testing push notifications using PHP and HTTP POST
In order for our server application to programmatically push notifications to a user or a group of users, you have to create a script that can push the notifications to the https://parse.com/ servers. This can be done by a variety of methods (via a desktop app, a .NET application, a web application, and so on), but for the purpose of this recipe, we will use PHP, which is simple, fast, and freely available.
How to do it…
First of all, we need to create the PHP script that will communicate with the Parse servers to send a push notification. There are plenty of free PHP/Apache hosting accounts available online for running the script, but if you don't have access to any, go to phpfiddle.org
and use it to enter and run the code. Use the following code, and remember to have your Parse app ID and REST API key ready:
<?php $APPLICATION_ID = "YOURPARSEAPPID"; $REST_API_KEY = "YOURPARSEAPIKEY"; $MESSAGE = "HELLO...