How To Start
Setup Firebase Messaging
1. Set up your project on the Firebase Console.
2. If you don’t have firebase project please click CREATE NEW PROJECT
Add a new project,
4. At the left top please select Project Settings
5. Select CLOUD MESSAGING and you will see Server Key
6. Copy Server Key to your plugin
7. Add it to your WP Thor FCM plugin – Server Key = Google API KEY
You can select in every post whether you want to send a notification or not. If you selected in the settings to not send a notification for new posts and updated posts, the box in the editor will be for default unchecked and vice versa.
The Message Types
Now the Plugin comes with 3 different Message Types out of the box.
The first one you already know, its the normal “message” one. The two others are “new_post” and “update”.
As FCM sends Messages in JSON format it needs some parameters.We did it in a way that’s is useful for every need, so you need 3 to 6 parameters for sending a message or something like that.
$message This parameter is for the data to be sent. Could be anything in a text or html format
$type This is the parameter for the notification type. By default there are three available:
- new_post this type is used for new posts
- update this type is used for updated posts
- message this type is used for plain text messages
$registration_id This parameter is used to set the ids to which the data should be sent. If you want to send it to all registrants please us 010 because otherwise it won’t work. Only set here directly ids if you are going to send it only to one or two but not more than 999 ids
$priority default 0. Set a number between 0-10 to set the priority of the message (10 = highest)
$time default value is 2419200. Set the time in seconds until self destruction of the message
$response default true. Set this to true to become as a response a full HTML output to be printed out, false to just become the plain response
So if a new post will be published, it automatically sends a FCM Message containing the post title, url, id and author, if your activated it under the settings.
The plugin provides a device list where you could see each device and its information. Here you have the possibility to directly delete a device from the database, or sort the table or search for a tag. If you click on the fcm id, it opens a detail page with information about the registered device and a stats of how many message were sent to this device. You can send a single message to this device.
The dashboard shows you statistics about the registered devices and their usage.
The plugin provides the option to export all the information to a excel readable file, with the whole information about every device (like registration date, id, stats, model, os, …). To export them, go to the “FCM” > “Settings” and select the “Export”-tab. This will generate a download link for you.