PHP code example of ladumor / one-signal

1. Go to this page and download the library: Download ladumor/one-signal 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/ */

    

ladumor / one-signal example snippets

injectablephp
    $fields = [
        'subscription'  => [],
    ];
    
    OneSignal::createSubscription($fields);
injectablephp
     $fields = [
        'subscription'  => [],
    ];
    
    OneSignal::updateSubscription($subscriptionId, $fields);
injectablephp
    $fields = [
        'identity'  => [],
    ];
    
    OneSignal::transferSubscription($subscriptionId, $fields);
injectablephp
    $params = [
        'limit' => 10,
        'offset' => 0,
        'channel' => 'push',
     ];
     
    OneSignal::viewTemplates($params);
injectablephp
    $fields = [
        'target_app_id' => "",
    ];
    
    OneSignal::copyTemplate($templateId, $fields);
injectablephp
php artisan one-signal.userDevice:publish