ngx-onesignal
ngx-onesignal copied to clipboard
Support for Safari
I am submitting a
- [x] Bug Report
What is the expected behavior?
Be able to get the user id through await OneSignal.getUserId()
What is the current behavior?
It returns a bug when subscribing as shown:
What are the steps to reproduce?
As far as I can see just creating the project as the example in the docs.
What is the use-case or motivation for changing an existing behavior?
Which versions are you using for the following packages?
Angular: 10.2.0 Angular CDK: 10.2.6 Angular CLI: 10.2.0 Nx (option): ngx-onesignal: 10.0.0
Is there anything else we should know?
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 :)