Skip to content
This repository has been archived by the owner on Oct 27, 2019. It is now read-only.

Complex data in push message #27

Open
svok opened this issue May 27, 2016 · 1 comment
Open

Complex data in push message #27

svok opened this issue May 27, 2016 · 1 comment

Comments

@svok
Copy link

svok commented May 27, 2016

The following code:

<?php
    $message = new \PHP_GCM\Message();
    $message->addData('test', ['xxx' => 'yyy']);
    $client = new \PHP_GCM\Sender($this->apiKey);
    $client->send($message, $token, $this->retryTimes);

generates an error: Expecting string but array id found.

The other function:

<?php
    $message = new \PHP_GCM\Message();
    $message->addData('test', ['xxx' => 'yyy']);
    $client = new \PHP_GCM\Sender($this->apiKey);
    $client->sendMulti($message, $token, $this->retryTimes);

works with no exceptions, but the JSON object comes as a string:

{
    "test": "{\"xxx\":\"yyy\"}"
}
@lkorth
Copy link
Owner

lkorth commented Jun 24, 2016

@svok which version are you encountering these errors? I believe they are only issues in 1.x versions.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants