Git Product home page Git Product logo

ng-push's People

Contributors

flauc avatar supamiu avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

ng-push's Issues

metadata issue.

Getting this error on ng serve:

ng-push.d.ts, found version 4, expected 3

Push not working after ng-build

Hi! The ng-push after built and deployed doesnot ask for permission. And when i send in the push, it shows that the user has not granted permission for push.

Its working on localhost though. Great job with the plugin.

Compatibility with Ivy

Hi, I am running into issues with this package in Angular 9 using Ivy.
Here is the error when building the project:


ERROR in node_modules/ng-push/index.d.ts:3:22 - error NG6002: Appears in the NgModule.imports of AppModule, but could not be resolved to an NgMod
ule class.

This likely means that the library (ng-push) which declares PushNotificationsModule has not been processed correctly by ngcc, or is not compatibl
e with Angular Ivy. Check if a newer version of the library is available, and update if so. Also consider checking with the library's authors to 
see if the library is expected to be compatible with Ivy.

3 export declare class PushNotificationsModule {
                       

Get user ID from permission

How can I get user's ID (to know which one to send the notification)?

_pushNotifications.requestPermission(); is just a simple void...

Notifications are not displayed on mobile devices

I use my Angular application from phones, Android or IOS and notifications are not shown. It is worth clarifying that if you ask for the permits.

Is it a kind of bug? Or is it not implemented for phones?

Angular 7 support

Hello!
Do you have plans for angular 7 support?
When I install ng-push on angular 7 app I've got this issues:

warning " > [email protected] " has incorrect peer dependency "@angular/core@^6.0.0".

Greetings,

how to click to the notification

thank you
i want when click to notification to open a new window
i did this code but is doesnt work

`let opiotns= {
body: res.data[0].title,
icon: this.imgUrl + '100x100/' + res.data[0].image,
timeOut: 5000,
showProgressBar: true,
clickToClose: true,
preventLastDuplicates: true

            }
            this._pushNotifications.create('',opiotns).subscribe(
               res.onclick = window.open(this.siteUrl + 'news/' + res.data[0].id)
            );`

requestPermission to be a promise

Can ng-push have requestPersmission to resolve into granted or denied. That would allow us to give certain information on what they will be lacking if denied.

For example:

this._push.requestPersmission.then((res)=>{
if(res=='granted')
     console.log('welcome')
})

window is not defined

When I install this script in a server/client environment, I have this error:
ReferenceError: the window is not defined

I solved it so far, like this:
To make co-exist with the SSR by importing the module in my browser-app. module. ts and not in the app. module. ts
├── app
│ ├── app.component.ts
│ ├── app.browser.module.ts
│ └── app.server.modue.ts
.......
├── index.html
├── main.browser.ts
└── main.server.ts

And in my component:

import { Component, OnInit, OnDestroy, Inject, PLATFORM_ID, Injector } from '@angular/core';
import {isPlatformBrowser } from '@angular/common';
...
@Component({ ...
})
export class HomeView implements OnInit, OnDestroy {
...
private _push:PushNotificationsService;
constructor(
    @Inject(PLATFORM_ID) platformId: string,
    private injector: Injector,
...
) {
    this.testBrowser = isPlatformBrowser(platformId);//Boolean
    if (this.testBrowser)this._push=this.injector.get(PushNotificationsService);//inject service only on browser platform
}

and it works well

Phone notifications broken - Illegal constructor. Use ServiceWorkerRegistration.showNotification() instead.

ERROR TypeError: Failed to construct 'Notification': Illegal constructor. Use ServiceWorkerRegistration.showNotification()

This happens on mobile. Chrome on Android to be specific.

Explanation here:
https://stackoverflow.com/a/29915743/331021

I think the library is great for Angular projects, it was very easy to use and it's a shame it doesn't work on phone.

I would fix this myself, but I'm not very good with JavaScript and this seems to require some additional logic:
https://developers.google.com/web/fundamentals/primers/service-workers/registration

Support Angular 6

npm WARN [email protected] requires a peer of @angular/core@^5.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of rxjs@^5.5.0 but none is installed. You must install peer dependencies yourself.

Support for angular 4.x.x

This is a...

  • feature request
  • bug report
  • usage question

Additional Notes:

Currently this project does not support Angular 4.x.

What do we need to change to implement the support?

Please add @NgModule annotation

When I import the module in this way:

import { PushNotificationsModule } from 'ng-push';
...
@NgModule({
    imports: [
        ...
        PushNotificationsModule,
        ...

I get this runtime error

Uncaught Error: Unexpected value 'PushNotificationsModule' imported by the module 'SharedModule'. Please add a @NgModule annotation.

I've upgraded to angular 5.0.0 and now try to use ng-push instead of angular2-notifications.

Module cause uncaught error in zone.js while browser loading NgModule metadata

Browser Chrome Version 62.0.3202.75

angular 5.0.0
tslint 5.8.0
typescript 2.6.1
webpack 3.8.1
zone.js 0.8.18

zone.js:196 Uncaught Error: Unexpected value 'PushNotificationsModule' imported by the module 'AppModule'. Please add a @NgModule annotation.
    at syntaxError (compiler.js:685)
    at eval (compiler.js:15307)
    at Array.forEach (<anonymous>)
    at CompileMetadataResolver.getNgModuleMetadata (compiler.js:15290)
    at CompileMetadataResolver.getNgModuleSummary (compiler.js:15217)
    at eval (compiler.js:15305)
    at Array.forEach (<anonymous>)
    at CompileMetadataResolver.getNgModuleMetadata (compiler.js:15290)
    at JitCompiler._loadModules (compiler.js:33703)
    at JitCompiler._compileModuleAndComponents (compiler.js:33664)

sound not playing

Hi, I am trying to use the ng push, and everything works fine, except playing the sound. I am passing the sound normally with the url as a string. This is my option object:
{ body: "Mensaje", icon: "../assets/img/logo/klogin.png", sound: "../assets/sounds/notification.mp3", silent: false }
The notification displays fine. It is even showing the icon correctly, but the sound never plays. Can anybody help me with this?, please.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.