PHP code example of projectmata / mobile-background-tasks
1. Go to this page and download the library: Download projectmata/mobile-background-tasks 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/ */
projectmata / mobile-background-tasks example snippets
use Projectmata\MobileBackgroundTasks\Facades\BackgroundTasks;
// Push the current schedule to the OS scheduler
BackgroundTasks::register();
// Trigger registered tasks immediately (testing only — bypasses constraints)
BackgroundTasks::runNow();
// Cancel a single task
BackgroundTasks::cancel('com.projectmata.task.sync_data');
// Inspect what's scheduled
$registered = BackgroundTasks::getRegistered();
// Or just see the descriptors the collector would push
$tasks = BackgroundTasks::tasks();