Configuration of a replica server with PUSH
By the moment, the platforms having PUSH implemented in the devices are Android and IOS.
In the devices the only configuration is for Android at the license.ini file, in which it is necessary to put 3 keys:
usepush=true.
shownotify=true or false. (For disabling the notifications at the notifications bar of the device)
googlepushsenderid=NUMBER_GOT_IN_THE_GOOGLE_DEVELOPERS_CONSOLE. (See below how to get it)
Using PUSH does not prevent that the device connects to the server from time to time for replicating as it does when there is not configured PUSH.
All the configuration which is defined below has place at the server part.
Tables and Necessary Fields
Master_Replica_SLAVE
Field | Description |
---|---|
PUSH | Text (30 characters). In this field is indicated which PUSH connector uses the MID at issue. Possible Values:
|
Master_Replica_CMDLOG
In this table NOTHING is configured, only WE HAVE TO CREATE THE FIELDS and those ones are automatically filled up.
Field | Description |
---|---|
PUSH | Text. It has the date and time in which the last updating attempt was sent to this client. |
PID | Text (300 characters). |
It has a “cookie” sent by the devices when starting session and it is used to recognaise that this terminal is registered with any PUSH provider and that this is the identifying element used.
REPLICATOR.INI
The keys here defined are CamelCase, observing upper case and lower case.
The configuration file “replicator.ini” used by the server for managing the replica databases needs a series of configuration strings by depending on the type of provider we want to configure. The strings by provider are described below:
Key | Value / Description |
---|---|
EnableSelectivePush | Mandatory, true or false. To specify if we are going to use or not the SELECTIVE PUSH system. |
PushThreshold | Mandatory, numeric. Minimum number of replica operations it must be to notify us. |
PushInterval | Mandatory, numeric. Time in seconds to check again if there are replica operations. |
PushNotifyOnce | Mandatory, true or false. Putting to true in order it sends us a single notification until we replicate the current operations, by avoiding that it is constantly notifying us. |
PushThreshold: 1
PushInterval: 5
PushNotifyOnce: true
In the previous lines we specify that when
En las líneas anteriores especificamos que cuando haya una operación ya nos notifique, que vuelva a chequear cada 5 segundos y que solo nos envíe otra notificación cuando repliquemos las que tenemos pendientes.
ANDROID
Key | Value / Description |
---|---|
GoogleAuthKey | Mandatory. A string in Base64 provided by the Google PUSH provider. It can be used the same for all the apps with replica. |
GoogleSenderId | Mandatory. A string in Base64 provided by the provider. At first it should have a different one for each application, although depending on the amount of terminals it can be used the same one whenever the minimum indicated by Google are not exceeded. |
Instructions to get the values
To get the values of googleauthkey and googlesenderid, we have to go to the APIs Google console, we must have a Google account to use these services. We can have more information in the following links:
Page | Description |
---|---|
http://developer.android.com/ | Information about everything related with the development for Android, in this page we will search in SERVICES - GOOGLE CLOUD MESSAGING - Getting Started (http://developer.android.com/google/gcm/index.html). |
https://console.developers.google.com | En this page we will have access to the values previously mentioned and we will be able to enable or disable the different services that Google makes available to us. |
1.- Entering at the Google APIs console page: https://code.google.com/apis/console/ and loging with the Google account. | 2.- We will be placed at the left menu in the “Overview” option, where we could see a “Project ID” with a number, this number will be the key googlesenderid that we need to our REPLICATOR.INI and for the license.ini file of the clients. |
---|---|
3.- We will be placed at the left menu at the “Services” option and here we will have to locate “Google Cloud Messaging for Android” and we must enable it. Once enabled it will ask us to accept the service terms and after having accepted we will have already the service available to be able to use it. | |
4.- We will be placed at the left menu at the “API Access” option where we will be able to locate the other key we need, in this case the API Key, that corresponds to googleauthkey in our REPLICATOR.INI. | |
5.- Putting the two keys in our Replicator.ini file within the project with [DBID-1] or which corresponds… |
APPLE
Key | Value / Description |
---|---|
ApplePushDeveloper | Optional. true, to specify that the Apple “sandbox” for development is used (By default), false, to specify that it is going to be used a production environment. |
ApplePushPort | Optional. In case having a different port than the standard one, it is possible to change it here. The value by default is the 2195 indicated by Apple. |
AppleCertName | Optional. Name of the certificate used to start a SSL session with the PUSH server. If it is not specified it is necessary to compulsorily indicate applecertfilename. The certificate can be referentiated by name (CN) or by any string in the readable fields. To used that way it is necessary to install it at the server. |
AppleCertFilename | Optional. It indicates the file name in which the certificate can be found to start SSL session in the PUSH provider. If it is not indicated it is necessary to compulsorily establishing applecertname. Usually it is abouta .p12 or .PFX file that includes the private key. |
AppleCertPwd | Optional. Access key to the certificate in case it is in a .PFX file or similar. The certificates installed at the repository of the server usually do not need this key because the user who executes the service is given with direct rights. |
BLACKBERRY
Key | Value / Description |
---|---|
BlackberryPushHost | Mandatory. It indicates the host to which the PUSH requests are sent to. Usually it varies depending on if there is BES or not. |
BlackberryPushPort | Optional. By default 8080. In cae using a BES or a BAS, the administrator can change the port used in security issues. |
Selective PUSH
The notifications PUSH sending can be set in a selective way, that is, to meet a certain conditions. For this, two new tables are availables, ADM_PUSH_SELECTED_TEMPLATE and MASTER_REPLICA_SELECTED_PUSH, the first one is the template to fill up the second one.
ADM_PUSH_SELECTED_TEMPLATE
Template to fill up the selectivity table of the replica push notifications.
ADM_PUSH_SELECTED_TEMPLATE |
---|
Field | Description |
---|---|
TABLENAME | Text (50). It has the table on which the condition is made. |
CRITERIA | Text. It has the selectivity criterion to meet to receive notifications. |
MESSAGE | Text (250). It has the message sent to the device. |
MASTER_REPLICA_SELECTED_PUSH
Selectivity table of the replica push notifications. It is filled up from the previous one.
MASTER_REPLICA_SELECTED_PUSH |
---|
Field | Description |
---|---|
TABLENAME | Text (50). It has the table on which the condition is made. |
MID | Numeric. Device identifier. |
CRITERIA | Text. It has the selectivity criterion to meet to receive the notification. |
MESSAGE | Text (250). It has the message to send to the device. |