@@ -45,17 +45,24 @@ After including the required files from the SDK, you need to initalize the Parse
4545``` php
4646ParseClient::initialize( $app_id, $rest_key, $master_key );
4747// Users of Parse Server will need to point ParseClient at their remote URL and Mount Point:
48- ParseClient::setServerURL('https://my-parse-server.com','parse');
48+ ParseClient::setServerURL('https://my-parse-server.com:port ','parse');
4949```
5050
5151If your server does not use or require a REST key you may initialize the ParseClient as follows, safely omitting the REST key:
5252
5353``` php
5454ParseClient::initialize( $app_id, null, $master_key );
5555// Users of Parse Server will need to point ParseClient at their remote URL and Mount Point:
56- ParseClient::setServerURL('https://my-parse-server.com','parse');
56+ ParseClient::setServerURL('https://my-parse-server.com:port ','parse');
5757```
5858
59+ Notice
60+ Parse server's default port is ` 1337 ` and the second parameter ` parse ` is the route prefix of your parse server.
61+
62+ For example if your parse server's url is ` http://example.com:1337/parse ` then you can set the server url using the following snippet
63+
64+ ` ParseClient::setServerURL('https://example.com:1337','parse'); `
65+
5966Usage
6067-----
6168
@@ -224,10 +231,33 @@ ParsePush::send(array(
224231 "data" => $data
225232), true);
226233
227- // Get Push Status Id
228- $reponse = ParsePush::send($data, true);
229- if(isset($response['_headers']['X-Push-Status-Id'])) {
230- // Retrieve info on _PushStatus using the id
234+ // Get Push Status
235+ $response = ParsePush::send($data, true);
236+ if(ParsePush::hasStatus($response)) {
237+
238+ // Retrieve PushStatus object
239+ $pushStatus = ParsePush::getStatus($response);
240+
241+ // get push status string
242+ $status = $pushStatus->getPushStatus();
243+
244+ if($status == "succeeded") {
245+ // handle a successful push request
246+
247+ } else if($status == "running") {
248+ // handle a running push request
249+
250+ } else if($status == "failed") {
251+ // push request did not succeed
252+
253+ }
254+
255+ // get # pushes sent
256+ $sent = $pushStatus->getPushesSent();
257+
258+ // get # pushes failed
259+ $failed = $pushStatus->getPushesFailed();
260+
231261}
232262```
233263
0 commit comments