I need to make notifications like facebook on mobile phones, I'm making an app using angularjs, ionic, jquery, javascript and nodejs ... is there any simple way to do this?
I need to make notifications like facebook on mobile phones, I'm making an app using angularjs, ionic, jquery, javascript and nodejs ... is there any simple way to do this?
You can use Onesignal , it is very simple to use, and the documentation is quite complete. Here is a simple example.
constructor(platform: Platform, statusBar: StatusBar, splashScreen: SplashScreen) {
platform.ready().then(() => {
statusBar.styleDefault();
splashScreen.hide();
var notificationOpenedCallback = function(jsonData) {
console.log('notificationOpenedCallback: ' + JSON.stringify(jsonData));
};
window["plugins"].OneSignal
.startInit("YOUR_APPID", "YOUR_GOOGLE_PROJECT_NUMBER_IF_ANDROID")
.handleNotificationOpened(notificationOpenedCallback)
.endInit();
});
}
You can check more in the documentation itself.
If your project is in ionic 3 you can use Ionic Native ....
import { OneSignal } from '@ionic-native/onesignal';
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();
You can also look at the documentation .