andrewscofield / parse.com-php-library

246 stars 137 forks source link

I am trying to send a push notification using query where objectId equals to #162

Open venkatiiitb opened 10 years ago

venkatiiitb commented 10 years ago

<?php include 'parse.php';

$parse = new parseRestClient(array( 'appid' => 'vpdCkLIeNtQQBNTIyroFqA7Lu4HXdYzvvxgvIZK4', 'restkey' => 'flkexIKpXRUmac6ofZvIPmbI77tEGb1u75F6Bi3O' ));

$params = array( 'objectId' => 'KPgFA2H1YG', 'object' => array( 'data' => array( 'alert' => 'This is alert message from venkat!', 'sound' => 'default', ) ) );

$request = $parse->notification($params);

print_r($request); ?>

But it's giving me errors what i am doing wrong

nicobistolfi commented 9 years ago

You should do something like this:

$params = array(
                    'object' => array(
                        'where' => array(
                            'objectId' => array('$in' => $ids)
                        ),
                        'data' => $data,
                    )
                );
$request = $parse_client->notification($params);