Push Notification extension

With the Push Notification extension, you can send push notifications to your iOS, Android, or desktop devices. This allows you to trigger alerts/notifications for important events in your system. You can use this feature in both interactive reports and scheduled reports.

The following push notification services are supported (you need to download the respective app to your device from the app store):

Configuration

The configuration is done via user/extension_init.php. You need to configure which service you use by default (you can override it in a report using dbr.push.options) and provide the respective API keys for each used service.

$mydbr_push = array( 
  'sender'  => "pushover", // Default sender: pushover, pushbullet, prowl
  'pushover_app_api_token'  => "APP_TOKEN",
  'pushbullet_access_token'  => "ACCESS_TOKEN",
  'pushsafer_private_key' => "PRIVATE_KEY"
);

Commands

dbr.push - Send a push message
dbr.push.sender - Choose another sender than the one defined in $mydbr_push init
dbr.push.option - Set a service-specific option
dbr.push.notify_successful_push - Disable the "Push message sent" message
dbr.push.log.proc - Log the push message activity to database
dbr.push.debug - Show status for each message sent

Syntax

select 'dbr.push';
select 'dbr.push.sender', 'prowl' | 'pushsafer' | 'pushover' | 'pushbullet'
select 'dbr.push.option', 'option', 'value'
select 'dbr.push.notify_successful_push', 0
select 'dbr.push.log.proc', 'sp_log_stored_procedure'
select 'dbr.push.debug', 1

Options for Prowl: providerkey', 'priority', 'application

providerkey
Your provider API key. Only necessary if you have been whitelisted
priority
-2: Very Low, -1: Moderate, 0: Normal, 1 High, 2 Emergency
application
The name of your application or the application generating the event

Options for Pushsafer (see Pushsafer dashboard)

private_key
If not provided in $mydbr_push
device
Single Device ID or Device Group ID or all Devices
sound
number 0-62
vibration
number 1-3
icon
number 1-181
iconcolor
Hexadecimal Colorcode, Example: #FF0000
url
URL/Link
urltitle
Title for the URL
picture
Data URL with Base64-encoded string
imagesize
0 = 1024px, 1 = 768px, 2 = 512px, 3 = 256px
timetolive
Integer number 0-43200: Time in minutes, after a message automatically gets purged
priority
-2 = lowest priority, -1 = lower priority, 0 = normal priority, 1 = high priority, 2 = highest priority
retry
Integer 60-10800 (60s steps): Time in seconds, after a message should resend
expire
Integer 60-10800: Time in seconds, after the retry/resend should stop
answer
1 = Answer is possible, 0 = Answer is not possible.
answeroptions
predefined answer options divided by a pipe character e.g. Yes|No|Maybe
forceanswer
1 = yes, 0 = no
confirm
Integer 10-10800 (10s steps) Time in seconds after which a message should be sent again before it is confirmed
giphygifcode
GIPHY GIF Code f.e. 8dMU9pN4pGwEfVpdY4

Options for Pushover:

token
If not provided in $mydbr_push
device
Your user's device name to send the message directly to that device, rather than all of the user's devices
url
A supplementary URL to show with your message
url_title
A title for the URL
priority
send as -2 to generate no notification/alert, -1 to always send as a quiet notification, 1 to display as high-priority and bypass the user's quiet hours, or 2 to also require a confirmation from the user
timestamp
A Unix timestamp of your message's date and time to display to the user, rather than the time your message is received by our API
sound
The name of one of the sounds supported by device clients to override the user's default sound choice

Options for Pushbullet:

access_token
If not provided in $mydbr_push
target
Push notification recipient type: 'device_iden', 'email', 'channel_tag' or 'client_iden'

Usage

Send a notification when the sender is defined

select 'dbr.push';

select 'John.Doe@gmail.com', 'Sales exceed $1M', 'Check the latest sales figures https://company.com/mydbr/report';

Define a sender and options

/* Send HTML mail */
select 'dbr.push';
select 'dbr.push.option', 'device', 'phone';
select 'dbr.push.option', 'sound', 'magic';
select 'dbr.push.log.proc', 'sp_mail_log';
select 'dbr.push.notify_successful_push', 0;
select 'dbr.push.sender', 'popover';

select 'us2e8xm87wiiba4s6vb3ik68pmqpfr', 'Title', 'Message body';