nickersoft / push.js Goto Github PK
View Code? Open in Web Editor NEWThe world's most versatile desktop notifications framework :earth_americas:
Home Page: https://pushjs.org
License: MIT License
The world's most versatile desktop notifications framework :earth_americas:
Home Page: https://pushjs.org
License: MIT License
Has this library been tested or working on IOS chrome or safari? or does it work with any browser on ios?
use edge browser
Does push api work in a chrome extension / background page?
i receive this error in FF on Win 10 when i click the notification that pops up on the demo site: https://nickersoft.github.io/push.js/
TypeError: notification is undefined
Push/closeNotification()push.min.js:97
Push/createCallback/wrapper.close()push.min.js:245
Push/createCallback/<()push.min.js:252
1push.min.js:97:1
which is line 97 in the non-minified script:
if (notification.close) {
The version published on npm doesn't include or generate the bin (now named dist) directory. Might be worth publishing a new version with the most recent changes.
Can push.js be used with angular 1.X. Example for such usage may be included
some functionality like facebook pushes
ideally the executables are kept in bin
.
thoughts?
I'd like to show a 5 second count down in a notification (5...4...3...2...1).
I can currently replace the notification by creating a new one with the same tag, however this animates each notification in and out making it hard to read/click. Is there a way around this?
Can you wrap a function to focus on the tab when the user click on the notification?
I tried to use the github raw text, but it interpreted it as plain text, so i would appreciate a link to a cdn for my webpage.
How to install this on meteor.js? I tried the npm install and insert this inside my app
import moment from 'push.js'; const Push = require('push.js');
But the Push is still undefined..
I've run into an issue when trying to install devDependencies after a regular NPM install. Here are the steps to reproduce:
npm install push.js
cd
into the push.js
directorynpm install
againIt attempts to install the devDependencies, but finishes with the following output:
npm ERR! Darwin 15.5.0
npm ERR! argv "/usr/local/Cellar/node/6.1.0/bin/node" "/usr/local/bin/npm" "install"
npm ERR! node v6.1.0
npm ERR! npm v3.8.6
npm ERR! path /Users/tjnickerson/Documents/Github/Nickersoft/push.js/test/node_modules/push.js/node_modules/.staging/push.js-05594a28
npm ERR! code ENOENT
npm ERR! errno -2
npm ERR! syscall rename
npm ERR! enoent ENOENT: no such file or directory, rename '/Users/tjnickerson/Documents/Github/Nickersoft/push.js/test/node_modules/push.js/node_modules/.staging/push.js-05594a28' -> '/Users/tjnickerson/Documents/Github/Nickersoft/push.js/test/node_modules/push.js'
npm ERR! enoent ENOENT: no such file or directory, rename '/Users/tjnickerson/Documents/Github/Nickersoft/push.js/test/node_modules/push.js/node_modules/.staging/push.js-05594a28' -> '/Users/tjnickerson/Documents/Github/Nickersoft/push.js/test/node_modules/push.js'
npm ERR! enoent This is most likely not a problem with npm itself
npm ERR! enoent and is related to npm not being able to find a file.
npm ERR! enoent
npm ERR! Darwin 15.5.0
npm ERR! argv "/usr/local/Cellar/node/6.1.0/bin/node" "/usr/local/bin/npm" "install"
npm ERR! node v6.1.0
npm ERR! npm v3.8.6
npm ERR! path npm-debug.log.2585175899
npm ERR! code ENOENT
npm ERR! errno -2
npm ERR! syscall open
npm ERR! enoent ENOENT: no such file or directory, open 'npm-debug.log.2585175899'
npm ERR! enoent ENOENT: no such file or directory, open 'npm-debug.log.2585175899'
npm ERR! enoent This is most likely not a problem with npm itself
npm ERR! enoent and is related to npm not being able to find a file.
npm ERR! enoent
npm ERR! Please include the following file with any support request:
npm ERR! /Users/tjnickerson/Documents/Github/Nickersoft/push.js/test/node_modules/push.js/npm-debug.log
The contents of the push.js
directory is then completely wiped. I've never encountered such behavior before while using NPM. Is anyone slightly more familiar with these kinds of errors and can perhaps provide some insight?
Since the minified version contains Promise polyfill, it doesn't fit well with webpack (and I would tell browserify neither) :
import Push from "push.js"
The Push object contains Promise instead of Push constructor.
This can be fixed in the package.json : the main file should be push.js and not push.min.js which is the "standalone" version.
Firefox does support service workers recently (46+), and it works as long as the browser is open (even if website tab is closed). But in code, service worker is only initialized for chrome and safari. that would be great to add firefox support as well
Bower support is in the works, and Push is currently registered with Bower, but an issue currently exists where running bower install push.js
does not actually contain any source code. This is currently being fixed. I just thought I'd let people know before y'all start trying to install using Bower.
Also important: as part of the fix, gulp
will be removed (for a second time).
I am looking for a way to keep the notification on screen until the user interacts with it (onclick event or clicks close). Is there a way to accomplish that for Chrome and Safari? (Chrome more importantly)
I did try setting timeout: 0, but that did not do anything. Also tried timeout: 120000 and the notification is still cleared after a shorter time.
To support wider scenarios that would be great to make service worker path a parameter. So for example adding different channels for anonymous ad logged in user becomes possible.
It recently occurred to me that the count
attribute of Push
is writeable, and it shouldn't be. The count
attribute should be wrapped inside a getter function. In addition, the count is never updated when a notification is closed via the close()
wrapped method. These changes won't be hard, but they're extremely important. Will address ASAP.
#50 seems to be a big bug which should have been updated already.
The first time a notification is created using Push.create
, the return value is undefined
. This is reproducible in the example.html
provided.
Because of this, calling close()
on the notification fails.
I'm looking for a way to integrate the library to allow GCM push notifications to be able to show messages on both desktop and mobile chrome browser.
Is it possible currently? If yes, how do I do it?
Great project!
However the description suggests support for all devices.
However it does not work on mobile devices. You do get the request the allow notifications, but a notification is never sent.
Is this support anticipated soon?
Just tested example.html and Chrome and it does not seem to be working (I believe it was working before). There is no error output in the console.
Hi,
As the title. hope you help.
Currently on browsers with service workers push.js is not able to handle any events on the notification.
Line 189 in 93014bc
The current uglify implementation removes all comments, including the license and attributions at the top of the file. Investigate into fixing, either via command-line tools or the reinstallation of gulp (with the gulp-uglify package).
I cannot call this an issue, but wondering if you could point me to good tutorial on setting up (admin) area to actually push the messages?
Wanting to use this in school classroom but like to learn more about using first. Hate to have a kid call me out on it:)
Thanks in advance for your input.
Woody
Sometime in the future, I would like to add more Karma tests to tighten up the testing process. Some examples would be:
Hi,
Is it possible to close a notification after the onClick function fired?
thanks.
Please, create bower package!
Test issue
Trying to run Push via Tonic results in the following error:
Tonic is a node environment, so window and other browser features won't exist. If you're just trying to access the global object, you can simply use global instead.
Not sure if similar errors exist in the real world. Has anyone used the library along with require.js or other AMD libraries? Will investigate this further.
Demo doesn´t work on Windows 10 with Edge Browser.
PushError: push.js is incompatible with self browser.
push.js (357,17)
I believe this is required for an up-to-date description on the NPM package page, so the README should be re-added to the distributed package.
The language in the description of this repo, on the site and in the readme seems to explicitly suggest that this works for desktop browsers only. But the Notifications API works on mobile browsers too. Is that intentional?
Noticed tonight after pushing the site redesign. Most likely broken for all of mobile. Will investigate.
Please send an update (0.0.10 ?) that contains the fix for issue #50. As it is now 0.0.9 still has that issue.
Cheers.
Hello guys,
Thanks for awesome library!
I have a feature request to show a dialog explaining what notifications will be sent to the user. I could not find similar example in the examples. Is there a way to know if permission popup is opened before calling Push.create?
Gulp was removed a few commits ago and replaced by npm build scripts to simplify the build process. However, the list of npm scripts has become rather long and gulp should be used to remedy this. One issue that currently stands is the removal of the license comment in the minified version. Though technically fixable using NPM, Gulp can fix this using the gulp-uglify package and will require fewer dependencies overall.
Hi, receiving this error on chrome mobile from the demo site.
08-22 01:07:33.115: I/chromium(32495): [INFO:CONSOLE(38)] "Uncaught (in promise) TypeError: Cannot read property 'addEventListener' of undefined", source: https://nickersoft.github.io/push.js/push.min.js (38)
I think it is because if it uses the service worker method, notification does not get defined.
its related to this issue #68
but i don't expect the events to work, those need to be done from within the service worker, for myself i just need it not to error getting the service worker loaded.
Is it possible to allow a subset of html tags for the message body? Currently tags are just displayed as text
I'm sure this is very simple so apologies for the stupid question, but how does one simply display the page that triggered the notification when the user clicks on it? I see there's an onClick option to execute a some js, but I don't actually need to do anything except re-focus the browser and go to the appropriate tab. I don't need to execute any js on the page.
Thanks in advance.
It would be great to adopt the following practices
It would be great if some of the additional option were added to the service worker showNotification constructor.
Particularly the Data option because that can be used in the service worker notification click, ie. to provide a URL for redirect.
Icon would be great too! :)
I just noticed that when I try to use an SVG image as the image for the push notification, nothing shows up.
Hey! Great plugin, but i found some issue.
I close a tab manually and when the notification timeout i have a "undefined" to the notification[id]. Becouse i close the notification, and that id still undefined in the array.
To bug fix i just add:
if (typeof(notification) === "undefined") {
return false;
}
At the function "closeNotification = function (id)".
Thanks :D
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.