First, if it’s not already done, you have to create an API Key on the Google Developer Console. Click here to see how.
Then, on your Siberian install, go to “Settings”->”Push”, and enter your API key in the “GCM Key” field.
Return on the Google Developer Console, on the left menu click on “Overview” and copy the “Project Number”.
Return on your Siberian install and in “Settings”->”Push”, and paste this project number in the “Sender ID” field.
Please note that these steps must be done before downloading your app sources and publishing your app on the stores!
If you want to activate the push notifications to send on a particular date:
You have to add an entry to your crontab.
A crontab is included in every server, and allows to execute some automatic tasks. You add an entry to the crontab and it executes the task when you have told him to do it. It can be a task to execute every 10am, every wednesday, etc.
In our case the crontab entry you have to create will launch the file that will check the subscriptions and update them.
Two ways to create your new crontab entry:
From the admin panel of your hosting
Search for your crontab manager. Add a new entry with these settings:
- Minute: */10
- Hour: *
- Day of Month: *
- Month: *
- Day of Week: *
- (And in the Command field): wget http://YOUR-SIBERIAN/push/message/send >/dev/null 2>&1
Connect to your server using your SSH root access.
Enter: crontab -e
Press “i” to enable the insertion mode
Add this line at the end (you will have to replace “YOUR-SIBERIAN” by the url address of your Siberian): */10 * * * * wget “http://YOUR-SIBERIAN/push/message/send >/dev/null 2>&1”
press the “Esc” key
Don’t forget to change “YOUR-SIBERIAN” by the address of your Siberian.
You are done!