Skip to content

phuocdaivl/azure-noti

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DaiDP Azure Notification

Create Registration and send notification

Latest Version on Packagist Software License Build Status Total Downloads

Download & Install

composer require phuocdaivl/azure-noti

Add service provider

Add the service provider to the providers array in the config/app.php config file as follows:

'providers' => [

    ...

    DaiDP\AzureNoti\Providers\AzureNotiServiceProvider::class,
]

Well done.

Basic use:

use \DaiDP\AzureNoti\PlatformFactory;

$endpoint = PlatformFactory::getEndpoint(PlatformFactory::ENDPOINT_FCM);

Methods

The following methods are available on the PlatformEndpoint instance.

createRegistration()

Create or update Registration ID

$fcmRegistration = 'fPDLWe0fKpY:APA91bHocOJCoKx5GV9ETT0bUmJDQAWiT8Ql4zFB5Ycr_sAm6tQ6aOmcTnGC3LwiyCa-beaXZoWrkxWTDvBkUVE8Th_XWNQUdzeNlbZ2MmT-lVj4Gxe4baoqVYYtmoAvZvZxghPZirOo';
$tags = ['tag1', 'tag2'];
$result = $endpoint->createRegistration($fcmRegistration, $tags);

sendNativeNotification()

Set new password for account

$message = new \DaiDP\AzureNoti\Message([
    'title' => 'Test push notification',
    'body' => 'great match!'
]);
$fcmRegistration = 'fPDLWe0fKpY:APA91bHocOJCoKx5GV9ETT0bUmJDQAWiT8Ql4zFB5Ycr_sAm6tQ6aOmcTnGC3LwiyCa-beaXZoWrkxWTDvBkUVE8Th_XWNQUdzeNlbZ2MmT-lVj4Gxe4baoqVYYtmoAvZvZxghPZirOo';
$result = $endpoint->sendNativeNotification($device, $message);

About

Create Registration and send notification

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages