You are here

public function PushNotificationsMessageSenderAccounts::generateTokens in Push Notifications 8

Parameters

array $accounts: Account objects.

Overrides PushNotificationsMessageSenderBase::generateTokens

File

src/PushNotificationsMessageSenderAccounts.php, line 47
Contains \Drupal\push_notifications\PushNotificationsMessageSenderAccounts.

Class

PushNotificationsMessageSenderAccounts
Send a simple message alert to a list of tokens..

Namespace

Drupal\push_notifications

Code

public function generateTokens() {
  foreach ($this->accounts as $account) {
    $user_tokens = push_notification_get_user_tokens($account
      ->id());
    if (!empty($user_tokens)) {
      $this->tokens = array_merge($this->tokens, $user_tokens);
    }
  }
}