App\Ninja\Notifications\PushFactory::message PHP Method

message() public method

Send a plain text only message to a single device.
public message ( $token, $message ) : void
$token - device token
$message - user specific message
return void
    public function message($token, $message)
    {
        PushNotification::app($this->certificate)->to($token)->send($message);
    }

Usage Example

 /**
  * pushMessage function
  *
  * method to dispatch iOS notifications
  *
  * @param Invoice $invoice
  * @param $token
  * @param $type
  */
 private function pushMessage(Invoice $invoice, $token, $type)
 {
     $this->pushFactory->message($token, $this->messageType($invoice, $type));
 }