public function setData($data)
    {
        if (!is_array($data)) {
            throw new \InvalidArgumentException(sprintf('Messages custom data must be array, "%s" given.', gettype($data)));
        }

        if (array_key_exists("aps", $data)) {
            unset($data["aps"]);
        }

        foreach ($data as $key => $value) {
            $this->addCustomData($key, $value);
        }

        return $this;
    }
public function setData($data)
    {
        if (!is_array($data)) {
            throw new \InvalidArgumentException(sprintf('Messages custom data must be array, "%s" given.', gettype($data)));
        }

        if (array_key_exists("aps", $data)) {
            unset($data["aps"]);
        }

        foreach ($data as $key => $value) {
            $this->addCustomData($key, $value);
        }

        return $this;
    }
public function setData ( $ data ) { if ( ! is_array ( $ data ) ) { throw new \ InvalidArgumentException ( sprintf ( 'Messages custom data must be array, "%s" given.' , gettype ( $ data ) ) ) ; } if ( array_key_exists ( "aps" , $ data ) ) { unset ( $ data [ "aps" ] ) ; } foreach ( $ data as $ key => $ value ) { $ this -> addCustomData ( $ key , $ value ) ; } return $ this ; }
Sets any custom data for the APS body

@param array $data
Sets any custom data for the APS body