msakamaki / ngx-onesignal Goto Github PK
View Code? Open in Web Editor NEWAnguler 7+ oneSingal service
Home Page: https://nicedoc.io/MSakamaki/ngx-onesignal
License: MIT License
Anguler 7+ oneSingal service
Home Page: https://nicedoc.io/MSakamaki/ngx-onesignal
License: MIT License
npm WARN [email protected] requires a peer of @angular/core@~7.2.0 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of rxjs@~6.3.3 but none is installed. You must install peer dependencies yourself.
I have installed as per instructions
Should work properly.
When I import NgxOneSignalModule I get this error related to not compatible with Angular Ivy
Try to install it with Angular 10+
Angular: 10.1.2
Angular CDK: 10.1.2
Angular CLI: 10.1.2
Nx (option):
ngx-onesignal: 0.0.7
Be able to get the user id through await OneSignal.getUserId()
It returns a bug when subscribing as shown:
As far as I can see just creating the project as the example in the docs.
Angular: 10.2.0
Angular CDK: 10.2.6
Angular CLI: 10.2.0
Nx (option):
ngx-onesignal: 10.0.0
This is my app.module:
NgxOneSignalModule.forRoot({
appId: 'my-app-id,
autoRegister: false,
allowLocalhostAsSecureOrigin: true,
notifyButton: {
enable: true,
},
}),
And my app.component:
import { Component, OnInit } from '@angular/core';
import { OneSignalService } from 'ngx-onesignal';
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.scss']
})
export class AppComponent implements OnInit {
constructor(public readonly onesignal: OneSignalService) {
(window as any).ngxOnesignal = this.onesignal;
}
ngOnInit(): void {
setTimeout(() => {
this.onesignal.subscribe();
console.log(`Initiated`);
}, 2000);
}
}
Also, I couldn't see anything about the safari_web_id
property as described in https://documentation.onesignal.com/docs/safari-web-push-setup, so, does this wrapper supports it?
My Safari version is 14.0 (15610.1.28.1.9, 15610) and I'm on a Mac OS Catalina 10.15.7.
You can access my example here https://onesignal-testing.surge.sh and also its repository on Github https://github.com/nncl/ngx-onesignal-test
I really appreciate your help :)
Angular:
Angular CDK:
Angular CLI:
Nx (option):
ngx-onesignal:
Hi,
I need to send tags using this module. I've found the method this.onesignal.send(method: OneSignalStubFuncionList, value: undefined)
but I don't know how to send a tag using this method.
Can you post an example using the .push(...)
method?
The module can be added without any problems
As soon as the module is added to the imports
of AppModule
the build fails with the following error:
ERROR in Error during template compile of 'NgModule'
Function calls are not supported in decorators but 'ɵmakeDecorator' was called.
Unexpected value '[object Object]' imported by the module 'AppModule in [...]/src/app/app.module.ts'. Please add a @NgModule annotation.
Error during template compile of 'Injectable'
Function calls are not supported in decorators but 'ɵmakeDecorator' was called.
Error during template compile of 'Injectable'
Function calls are not supported in decorators but 'ɵmakeDecorator' was called.
Error during template compile of 'Injectable'
Function calls are not supported in decorators but 'ɵmakeDecorator' was called.
Error during template compile of 'Injectable'
Function calls are not supported in decorators but 'ɵmakeDecorator' was called.
Error during template compile of 'Injectable'
Function calls are not supported in decorators but 'ɵmakeDecorator' was called.
Error during template compile of 'Injectable'
Function calls are not supported in decorators but 'ɵmakeDecorator' was called.
Error during template compile of 'Injectable'
Function calls are not supported in decorators but 'ɵmakeDecorator' was called.
Error during template compile of 'Injectable'
Function calls are not supported in decorators but 'ɵmakeDecorator' was called.
Error during template compile of 'NgModule'
Function calls are not supported in decorators but 'ɵmakeDecorator' was called.
Error during template compile of 'Injectable'
Function calls are not supported in decorators but 'ɵmakeDecorator' was called.
As soon as I remove the import then the app compiles normally again
Create a Angular v8 app following the documented steps and try to compile in production mode.
Angular: 8.2.3
Angular CLI: 8.3.0
ngx-onesignal: 0.0.7
Get userId and pushToken
Angular: 9.1.2
Angular CDK:
Angular CLI: latest
Nx (option):
ngx-onesignal: latest
exec command
npx @angular/cli add @nguniversal/express-engine --clientProject [project name]
npm install ngx-onesignal
node: 14.15.4
Wanted node version 12 (>=12.0.0 <13.0.0)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] preinstall: `npx check-node-version --node 12`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] preinstall script.
Is it really need restrict node version to 12?
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.