You are here

public function FirebaseMessageService::setNotification in Firebase Push Notification (FCM) 8

Same name and namespace in other branches
  1. 3.0.x src/Service/FirebaseMessageService.php \Drupal\firebase\Service\FirebaseMessageService::setNotification()

Add notification to message.

Parameters

array $notification: Notification options.

File

src/Service/FirebaseMessageService.php, line 196

Class

FirebaseMessageService
Service for pushing message to mobile devices using Firebase.

Namespace

Drupal\firebase\Service

Code

public function setNotification(array $notification) {
  if (!empty($notification['title'])) {
    $this->body['notification'] = $notification;
  }
}