export class DuyurularPage {
duyurular: any;
loading: any;
constructor(public navCtrl: NavController, public navParams: NavParams, public loadingPage: LoadingController,
platform: Platform, statusBar: StatusBar, splashScreen: SplashScreen) {
this.loading = this.loadingPage.create({
content: `
<ion-spinner></ion-spinner>`
});
platform.ready().then(() => {
statusBar.styleDefault();
splashScreen.hide();
// Retrieve notification data and assign it to the 'duyurular' variable
var notificationOpenedCallback = function (jsonData) {
this.duyurular = jsonData.notification.payload;
};
alert
window["plugins"].OneSignal
.startInit("12312412412412", "1231241212")
.handleNotificationOpened(notificationOpenedCallback)
.endInit();
});
}
}
var notificationOpenedCallback = function...
← Within this function, accessing this.duyurular
is not possible.
I need to populate the array (duyurular
) with data from a JSON source. How should I proceed?