function push_notifications_help in Push Notifications 8
Implements hook_help().
File
- ./
push_notifications.module, line 35 - Contains push_notifications.module functionality.
Code
function push_notifications_help($route_name, RouteMatchInterface $route_match) {
switch ($route_name) {
// Main module help for the push_notifications module.
case 'help.page.push_notifications':
$PushHandler = \Drupal::service('push_notifications.message_sender_accounts');
$PushHandler
->setAccounts(array(
Drupal::currentUser(),
));
$PushHandler
->setMessage('This is my test payload.');
$PushHandler
->dispatch();
$output = '';
$output .= '<h3>' . t('About') . '</h3>';
$output .= '<p>' . t('Push notification functionality for iPhone and Android.') . '</p>';
$output .= '<p>' . t('The full documentation is available online: <a href="@doc_url" target="_blank">Documentation</a >.', array(
'@doc_url' => 'https://www.drupal.org/node/2718063',
)) . '</p>';
$output .= '<p>' . t('You can manually send out a push notification @message_link.', array(
'@message_link' => Link::createFromRoute('from the admin section', 'push_notifications.send_message_form')
->toString(),
)) . '</p>';
return $output;
}
}