pushpad / pushpad-php Goto Github PK
View Code? Open in Web Editor NEWPHP library for the Pushpad API: the easiest way to send push notifications from websites and web apps.
Home Page: https://pushpad.xyz
License: MIT License
PHP library for the Pushpad API: the easiest way to send push notifications from websites and web apps.
Home Page: https://pushpad.xyz
License: MIT License
It would be very useful if the library included a simple function check if there's already a subscription with a certain user id.
This would make it possible to check server-side if it is necessary to prompt the user to enable them.
I know it's already possible to check using JS or the REST API but it would be handy for certain scenarios if a simple function for this was included in the PHP library.
Currently, neither of the public functions in notification.php return the curl request data, although the private function "deliver" in the class does.
Also, the request currently only returns one line of data, so on line 43:
list($header, $body) = explode("\r\n\r\n", $res, 2);
$body is never set. $res might be all that is needed, currently.
The filenames for your class declarations are currently all lowercase, while the classes start with an uppercase letter. This causes psr-4 autoloading to fail for case sensitive file systems (such as centos). Would it be possible to update the class files in /lib/ from
pushpad.php
notification.php
to
Pushpad.php
Notification.php
There is a problem with deliver_to function. I try to use example code, but I got error if I use this function like this:
$notification->deliver_to($user_ids);
I fixed it by calling this function this way:
$notification->deliver_to($user_ids, ["tags" => null]);
In deliver_to function, just before this line (48):
return $this->deliver($this->req_body($uids, $options['tags']), $options);
there should be something like this:
if (!isset($options['tags'])) { $options['tags']=null; }
(Translated by Google)
Hello
Is it possible to configure a TTL ( time to live) ?
I mean, how long the notification is waiting to be delivered.
If the time expires, the notification becomes obsolete , and is eliminated
Thank you
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.