src/Mcfedr/AwsPushBundle/Message/Message.php
private function getApnsJsonInner(?string $text): array
    {
        $apns = [
            'aps' => [],
        ];

        if (null !== $this->localizedKey) {
            $apns['aps']['alert'] = [
                'loc-key' => $this->localizedKey,
            ];
            if ($this->localizedArguments) {
                $apns['aps']['alert']['loc-args'] = $this->localizedArguments;
            }
        } elseif (null !== $text) {
            $apns['aps']['alert'] = $text;
        }

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

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

        if (null !== $this->sound) {
            $apns['aps']['sound'] = $this->sound;
        }

        $merged = $this->arrayMergeDeep($apns, $this->custom, $this->apnsData ? $this->apnsData : []);

        // Force aps to be an object, because it shouldnt get encoded as [] but as {}
        if (!\count($merged['aps'])) {
            $merged['aps'] = new \stdClass();
        }

        return $merged;
    }
private function getApnsJsonInner(?string $text): array
    {
        $apns = [
            'aps' => [],
        ];

        if (null !== $this->localizedKey) {
            $apns['aps']['alert'] = [
                'loc-key' => $this->localizedKey,
            ];
            if ($this->localizedArguments) {
                $apns['aps']['alert']['loc-args'] = $this->localizedArguments;
            }
        } elseif (null !== $text) {
            $apns['aps']['alert'] = $text;
        }

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

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

        if (null !== $this->sound) {
            $apns['aps']['sound'] = $this->sound;
        }

        $merged = $this->arrayMergeDeep($apns, $this->custom, $this->apnsData ? $this->apnsData : []);

        // Force aps to be an object, because it shouldnt get encoded as [] but as {}
        if (!\count($merged['aps'])) {
            $merged['aps'] = new \stdClass();
        }

        return $merged;
    }
Get the correct apple push notification server data.