PHP code example of dwade75 / onesignalbundle

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

    

dwade75 / onesignalbundle example snippets


composer 

public function registerBundles()
    {
        $bundles = [
            new Dwade75\OnesignalBundle\Dwade75OnesignalBundle(),
        ];
    }

$app = new AppsController();
    $app->getApps();
    $app->getAppById();
    $app->createApp(array('name' => 'Api testing','apns_env' => 'sandbox'));
    $app->editAppById(array('name' => 'update update Api testing','apns_env' => 'sandbox'));
    
  
### Notifications: ###
$notification = new NotificationsController();
    $notification->createNotification(['contents' => ['en' => 'Super message from api'], ');

$players = new PlayersController();
    $players->getPlayersDevices();
    $players->getPlayerDevicesById('32dc08b1-6c71-4a8a-af0a-8ee79c9bf1b5');
    $players->createPlayerDevices(['device_type' => 0]);
    $players->editPlayerDevices('9ae055c8-955b-4450-8a96-4a81f97e293a', ['device_type' => 1]);
    $players->createPlayerOnSession('9ae055c8-955b-4450-8a96-4a81f97e293a',['timezone' => '-28800', 'game_version' => '1.0', 'device_os' => '7.0.4']);
    $players->createPlayerOnPurchase('9ae055c8-955b-4450-8a96-4a81f97e293a', ['sku' => 'SKU123', 'iso' => 'USD', 'amount' => '0.99']);
    $players->createPlayerOnFocus('9ae055c8-955b-4450-8a96-4a81f97e293a', ['state' => 'ping', 'active_time' => 60]);
    $players->createPlayerCsvExport();