Skip to content

Commit ffa336d

Browse files
author
Benjamin Wilson Friedman
authored
Updated README for ParsePush and master key usages
1 parent 1150217 commit ffa336d

File tree

1 file changed

+19
-6
lines changed

1 file changed

+19
-6
lines changed

README.md

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -93,8 +93,11 @@ $object->setAssociativeArray(
9393
"languageTypes", array("php" => "awesome", "ruby" => "wtf")
9494
);
9595

96-
// Save:
96+
// Save normally:
9797
$object->save();
98+
99+
// Or pass true to use the master key to override ACLs when saving:
100+
$object->save(true);
98101
```
99102

100103
Users:
@@ -148,9 +151,12 @@ $object = $query->get("anObjectId");
148151

149152
$query->limit(10); // default 100, max 1000
150153

151-
// All results:
154+
// All results, normally:
152155
$results = $query->find();
153156

157+
// Or pass true to use the master key to override ACLs when querying:
158+
$results = $query->find(true);
159+
154160
// Just the first result:
155161
$first = $query->first();
156162

@@ -200,22 +206,29 @@ Push:
200206
```php
201207
$data = array("alert" => "Hi!");
202208

209+
// Parse Server requires the master key for sending push. Pass true as the second parameter.
210+
ParsePush::send($data, true);
211+
203212
// Push to Channels
204213
ParsePush::send(array(
205214
"channels" => ["PHPFans"],
206215
"data" => $data
207-
));
216+
), true);
208217

209218
// Push to Query
210219
$query = ParseInstallation::query();
211220
$query->equalTo("design", "rad");
221+
212222
ParsePush::send(array(
213223
"where" => $query,
214224
"data" => $data
215-
));
225+
), true);
216226

217-
// Parse Server requires the master key for sending push. Pass true as the second parameter.
218-
ParsePush::send($data, true);
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
231+
}
219232
```
220233

221234
Contributing / Testing

0 commit comments

Comments
 (0)