Unable to push notifications based on filter

I am unable to send notification message based on FILTER

Here is the php function I am using

function send_notification_user_only($message,$username)
{

$url = "https://api.appery.io/rest/push/msg";

$messageArray["payload"]=array("message"=>"$message","badge"=>"1");
$messageArray["filter"]=array("userName"=>"$username");
$messageArray["status"]="sent";
$headers = array(
'X-Appery-Push-Master-Key: 7319c*************************d',
'Content-type: application/json'
);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($messageArray));
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($ch,CURLOPT_HTTPHEADER,$headers);
$result = curl_exec($ch);
print_r($result);
}


Here is the result of the print_r


[{ "_id":"532bf364e4b******e4efba",
"count":0,
"dbId":"52f4ccf2e4b0cc********",
"errorMessages":{},
"filter":"{
[{ "_id":"532bf364e4b******e4efba",
"count":0,
"dbId":"52f4ccf2e4b0cc********",
"errorMessages":{},
"filter":"{ \"userName\" : \"ankwad\"}",
"payload":{"badge":1,
"message":"Congrats!! Your "},
"schedule":{"scheduledTime":"2014-03-21 08:08:00.000",
"scheduledTimeInTZ":"2014-03-21 08:08:00.000",
"timeZone":0,
"useDeviceTimeZone":false},
"status":"wait"}
}]
quot;userName
[{ "_id":"532bf364e4b******e4efba",
"count":0,
"dbId":"52f4ccf2e4b0cc********",
"errorMessages":{},
"filter":"{ \"userName\" : \"ankwad\"}",
"payload":{"badge":1,
"message":"Congrats!! Your "},
"schedule":{"scheduledTime":"2014-03-21 08:08:00.000",
"scheduledTimeInTZ":"2014-03-21 08:08:00.000",
"timeZone":0,
"useDeviceTimeZone":false},
"status":"wait"}
}]
quot; :
[{ "_id":"532bf364e4b******e4efba",
"count":0,
"dbId":"52f4ccf2e4b0cc********",
"errorMessages":{},
"filter":"{ \"userName\" : \"ankwad\"}",
"payload":{"badge":1,
"message":"Congrats!! Your "},
"schedule":{"scheduledTime":"2014-03-21 08:08:00.000",
"scheduledTimeInTZ":"2014-03-21 08:08:00.000",
"timeZone":0,
"useDeviceTimeZone":false},
"status":"wait"}
}]
quot;ankwad
[{ "_id":"532bf364e4b******e4efba",
"count":0,
"dbId":"52f4ccf2e4b0cc********",
"errorMessages":{},
"filter":"{ \"userName\" : \"ankwad\"}",
"payload":{"badge":1,
"message":"Congrats!! Your "},
"schedule":{"scheduledTime":"2014-03-21 08:08:00.000",
"scheduledTimeInTZ":"2014-03-21 08:08:00.000",
"timeZone":0,
"useDeviceTimeZone":false},
"status":"wait"}
}]
quot;}",
"payload":{"badge":1,
"message":"Congrats!! Your "},
"schedule":{"scheduledTime":"2014-03-21 08:08:00.000",
"scheduledTimeInTZ":"2014-03-21 08:08:00.000",
"timeZone":0,
"useDeviceTimeZone":false},
"status":"wait"}
}]


I fail to understand why status is coming to be wait.

Also in appery push notification the message is coming under scheduled messages with error "unregistered device"
1 person has
this question
+1
This topic is no longer open for comments or replies.