// config/broadcasting.php
'connections' => [
...
'apn' => [
'driver' => 'jwt',
'is_production' => env('APP_ENV') === 'production',
'key_id' => env('APN_KEY_ID'), // The Key ID of the p8 file (available at https://developer.apple.com/account/ios/authkey/)
'team_id' => env('APN_TEAM_ID'), // The Team ID of your Apple Developer Account (available at https://developer.apple.com/account/#/membership/)
'app_bundle_id' => env('APN_APP_BUNDLE_ID'), // The Bundle ID of your application. For example, "com.company.application"
'private_key_path' => env('APN_PRIVATE_KEY', storage_path('apns-private-key.p8')),
'private_key_secret' => env('APN_PRIVATE_KEY_SECRET'),
],
...
],
use Illuminate\Notifications\Notification;
use SemyonChetvertnyh\ApnNotificationChannel\ApnMessage;
class AccountApproved extends Notification
{
/**
* Get the notification's delivery channels.
*
* @param mixed $notifiable
* @return array
*/
public function via($notifiable)
{
return ['apn'];
}
/**
* Get the APN representation of the notification.
*
* @param mixed $notifiable
* @return ApnMessage
*/
public function toApn($notifiable)
{
return ApnMessage::create()
->badge(1)
->title('Account approved')
->body("Your {$notifiable->service} account was approved!");
}
}
/**
* Route notifications for the APN channel.
*
* @return string|array
*/
public function routeNotificationForApn()
{
return $this->apn_token;
}
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.