src/Encoder/PayloadEncoder.php
private function convertApsToArray(Aps $aps): array
    {
        $data = [
            'alert' => $this->convertAlertToArray($aps->getAlert()),
        ];

        if ($aps->getSound()) {
            $data['sound'] = $aps->getSound();
        }

        if ($aps->getBadge() !== null) {
            $data['badge'] = $aps->getBadge();
        }

        if ($aps->getCategory()) {
            $data['category'] = $aps->getCategory();
        }

        if ($aps->isContentAvailable()) {
            $data['content-available'] = 1;
        }

        if ($aps->isMutableContent()) {
            $data['mutable-content'] = 1;
        }

        if ($aps->getThreadId()) {
            $data['thread-id'] = $aps->getThreadId();
        }

        return $data;
    }
private function convertApsToArray(Aps $aps): array
    {
        $data = [
            'alert' => $this->convertAlertToArray($aps->getAlert()),
        ];

        if ($aps->getSound()) {
            $data['sound'] = $aps->getSound();
        }

        if ($aps->getBadge() !== null) {
            $data['badge'] = $aps->getBadge();
        }

        if ($aps->getCategory()) {
            $data['category'] = $aps->getCategory();
        }

        if ($aps->isContentAvailable()) {
            $data['content-available'] = 1;
        }

        if ($aps->isMutableContent()) {
            $data['mutable-content'] = 1;
        }

        if ($aps->getThreadId()) {
            $data['thread-id'] = $aps->getThreadId();
        }

        return $data;
    }
Convert APS data to array

@param Aps $aps

@return array