HEX
Server: Apache/2.4.59 (Debian)
System: Linux skycube.cz 4.19.0-25-amd64 #1 SMP Debian 4.19.289-2 (2023-08-08) x86_64
User: ilya (534)
PHP: 7.3.31-1~deb10u7
Disabled: pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,
Upload Files
File: /var/www/ilya/data/www/povoleni.com/test/debugscript.php
<?php

// $_POST['code']; // если пустой и action_id=3, то проверяет все заявления
// $_POST['token'];
// $_POST['action_id']; // 1 - add; 2 - remove; 3 - check
// $_POST['lang']; ru, cs, en

// https://www.povoleni.ru/services/mobileapp/

define(API_KEY, 'AAAAZR2zAfk:APA91bE4HaixRtue11Tg8udsMsEj5PWR0_S1xJ2uQ7txWbYkh-lgIYtqmnLxhsBldvRb2OSDAagm4qFKRIAFpFSPm3SuFIEa5MXumItF0m_-Y3fDeP8QIgarerVjaVJa_oeEAMNVWn_g');

$url = 'https://fcm.googleapis.com/fcm/send';

$code = $_POST['code'];
$token = $_POST['token'];

$status = 3;
$date = '2017-07-01 12:03:00';
$comment = 'Vyřízeno – POVOLENO';


$fields = array(
    'data' => array(
        'click_action' => 'FLUTTER_NOTIFICATION_CLICK',
        'application' => array(
            'code' => $code,
            'status' => $status,
            'date' => $date,
            'comment' => $comment
        )
    ),
    'to' => $token
);

$headers = array(
    'Authorization: key=' . API_KEY,
    'Content-Type:application/json'
);

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($fields));
$result = curl_exec($ch);
curl_close($ch);

echo $result;

?>