Bellow is my sample notification class. In that i am sending push notification using Apn Channel. But I don't get any response. When i try to dd() in toApn method at that time i get null.
<?php
namespace App\Notifications;
use Illuminate\Bus\Queueable;
use Illuminate\Notifications\Notification;
use Illuminate\Contracts\Queue\ShouldQueue;
use Edujugon\PushNotification\Channels\ApnChannel;
use Edujugon\PushNotification\Messages\PushMessage;
class SamplePushNotification extends Notification Implements ShouldQueue
{
use Queueable;
/**
* Create a new notification instance.
*
* @return void
*/
public function __construct()
{
//
}
/**
* Get the notification's delivery channels.
*
* @param mixed $notifiable
* @return array
*/
public function via($notifiable)
{
return [ApnChannel::class];
}
public function toApn($notifiable)
{
return new PushMessage('Hello world');
}
Bellow is my sample notification class. In that i am sending push notification using Apn Channel. But I don't get any response. When i try to dd() in toApn method at that time i get null.
<?php
namespace App\Notifications;
use Illuminate\Bus\Queueable; use Illuminate\Notifications\Notification; use Illuminate\Contracts\Queue\ShouldQueue; use Edujugon\PushNotification\Channels\ApnChannel; use Edujugon\PushNotification\Messages\PushMessage; class SamplePushNotification extends Notification Implements ShouldQueue { use Queueable;
}