Dialog push service
Dialog Push Service (DPS) is a tiny service for pushing remote notifications.
DPS consists of two sub-projects:
- gRPC server that does actual delivery
- Scala module for Dialog Server which provides Scala bindings to gRPC server
Getting Started
You need to install go, protobuf and gogo-protobuf extensions:
brew install go
brew install protobuf
go get github.com/gogo/protobuf/proto
go get github.com/gogo/protobuf/protoc-gen-gogoslick
go get github.com/gogo/protobuf/gogoproto
You also need to make sure the protoc-gen-gogoslick
is in the $PATH
.
Config
google:
- project-id: <string>
key: <string>
retries: <number>
timeout: <string>
nop-mode: <boolean>
workers: <number>
allow-alerts: <boolean>
sandbox: <boolean>
properties:
- project-id - identificator of the provider
- key
- retries - count retries by server error
- timeout - time duration. Example: 1s, 2m
- nop-mode - if the option is set to true, the message will not be sent
- workers - count workers for sending. By default the value is equal count of processors.
- allow-alerts - enabled alerting messages for converter protobuf push message to a notification message
- sandbox - if the option is set to true, the message will not be actually sent. Instead FCM performs all the necessary validations, and emulates the send operation
fcm:
- project-id: <string>
service-account: <string>
retries: <number>
timeout: <string>
nop-mode: <boolean>
workers: <number>
allow-alerts: <boolean>
sandbox: <boolean>
properties:
- project-id - identificator of the provider
- service-account
- retries - count retries by server error
- timeout - time duration. Example: 1s, 2m
- nop-mode - if the option is set to true, the message will not be sent
- workers - count workers for sending. By default the value is equal count of processors.
- allow-alerts - enabled alerting messages for converter protobuf push message to a notification message
- sandbox - if the option is set to true, the message will not be actually sent. Instead FCM performs all the necessary validations, and emulates the send operation
apple:
- project-id: <string>
pem: <string>
retries: <number>
timeout: <string>
nop-mode: <boolean>
workers: <number>
allow-alerts: <boolean>
sandbox: <boolean>
properties:
- project-id - identifier of the provider
- pem - path to tls certificate in pem format
- retries - count retries by server error
- timeout - time duration. Example: 1s, 2m
- nop-mode - if the option is set to true, the message will not be sent
- workers - count workers for sending. By default the value is equal count of processors.
- allow-alerts - enabled alerting messages for converter protobuf push message to a notification message
- topic - the topic of the remote notification, which is typically the bundle ID for your ap
- sound - sound of the alerting message
Test environment
- download iOS certificate in PEM format
- create environment variable APPLE_PUSH_CERTIFICATE with path to PEM
- download service-account.json
- create environment variable GOOGLE_APPLICATION_CREDENTIALS with path to service-account.json
- copy server key
- save server key in a file. File format:
{
"key":"<server key>"
}
- create environment variable GOOGLE_LEGACY_APPLICATION_CREDENTIALS with path to server key file
- create devices tokens file. File format:
{
"android": "<token>",
"ios": "<token>"
}
- create environment variable PUSH_DEVICES with path to devices tokens file
Metrics
Metrics split by provider type and project identifier:
- processed_tasks -quantity of successfully sent push-notifications.
- failed_tasks - quantity of push-notifications with errors.
- io - time of sending push-notifications
- pushes_recv - quantity of push-notifications received from IP of a sender.
Client application
Android
Build and run:
License
This software is available under the Apache 2.0 License