parse-server icon indicating copy to clipboard operation
parse-server copied to clipboard

Parse Push - PHP SDK

Open Copyrightsworld opened this issue 10 years ago • 2 comments

Hi all,

I tried to test the new "opened sourced" push functionality of the Parse Server, using a PHP app i had build when parse was hosted.

The new setup (on heroku) tried to trigger a file "ParsePush.php" which is not available as far as i can see (ERROR: 3.4251 1228744 Parse\ParseClient::_request( ) ../ParsePush.php:75).

Maybe this will be available soon on a PHP SDK update? Am i missing something here ?

Copyrightsworld avatar Feb 15 '16 08:02 Copyrightsworld

I just updated the PHP SDK to version 1.2.0, you can now change the server url after initialization with

ParseClient::setServerURL('http://localhost:1337/parse');

To send push, you'll need to pass the second parameter as true to use the master key:

ParsePush::send($data, true);

If you have trouble, re-open or post a new issue. Thanks

gfosco avatar Feb 16 '16 16:02 gfosco

Thank you @gfosco . I did what you said and now i get no errors.

Here is the trick though. When i use the cURL code from http://blog.parse.com/announcements/parse-server-push-notifications/ to test my server, i DO receive the notification on my phone.

When i try to push via code (php), i get NO errors on my heroku logs, but no notification is delivered (this code was working when i was on Parse hosting).

Any thoughts on that?

Thnx again.

Copyrightsworld avatar Feb 25 '16 07:02 Copyrightsworld