PHP code example of pteal79 / native-notification

1. Go to this page and download the library: Download pteal79/native-notification library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

pteal79 / native-notification example snippets


use PTeal79\NativeNotification\Facades\NativeNotification;

NativeNotification::sendNotification('Hello world!');
NativeNotification::sendNotification(null);

use Native\Mobile\Attributes\OnNative;
use PTeal79\NativeNotification\Events\MobileEvent;

#[OnNative(MobileEvent::class)]
public function handleNativeNotification(?string $message): void
{
    // $message is the string passed to sendNotification()
}
bash
composer vendor:publish --tag=nativephp-plugins-provider
php artisan native:plugin:register pteal79/native-notification
php artisan native:plugin:list