Reputation: 1029
Hi there? I'm in the problem. I'm finding a way to not display a notification when I'm on chat screen like if I chat somebody so do no any notification received against this user.
i'm using ionic 4 one signal plugin.
import { OneSignal } from '@ionic-native/onesignal/ngx';
constructor(private oneSignal: OneSignal) { }
...
this.oneSignal.startInit('b2f7f966-d8cc-11e4-bed1-df8f05be55ba', '703322744261');
this.oneSignal.inFocusDisplaying(this.oneSignal.OSInFocusDisplayOption.InAppAlert);
this.oneSignal.handleNotificationReceived().subscribe(() => {
// do something when notification is received
});
this.oneSignal.handleNotificationOpened().subscribe(() => {
// do something when a notification is opened
});
this.oneSignal.endInit();
Please help me. find any solution.
Upvotes: 0
Views: 1036
Reputation: 1571
Simon Grimm at Devdactic.com is a great Ionic resource. He has a tutorial to integrate OneSignal push notifications into an Ionic app. A step by step video is here and the blog is here. Hope this helps.
Upvotes: 1