this.apiProvider.data is not a function

import { Component, ViewChild } from ‘@angular/core’;
import { Nav, Platform, AlertController } from ‘ionic-angular’;
import { StatusBar } from ‘@ionic-native/status-bar’;
import { SplashScreen } from ‘@ionic-native/splash-screen’;
import { SlidingPage } from ‘…/pages/sliding/sliding’;
import { LoginPage } from ‘…/pages/login/login’;
import { ProfilePage } from ‘…/pages/profile/profile’;
import { MybookingsPage } from ‘…/pages/mybookings/mybookings’;
import { MyoffersPage } from ‘…/pages/myoffers/myoffers’;
import { MymessagesPage } from ‘…/pages/mymessages/mymessages’;
import { SettingsPage } from ‘…/pages/settings/settings’;
import { MaintabsPage } from ‘…/pages/maintabs/maintabs’;
import { SubtabsPage } from ‘…/pages/subtabs/subtabs’;
import { GalleryPage } from ‘…/pages/gallery/gallery’;
import { ApiProvider } from ‘…/providers/api/api’;

import { FCM } from ‘@ionic-native/fcm’;
import { RestaurantidPage } from ‘…/pages/restaurantid/restaurantid’;
import { RestaurantPage } from ‘…/pages/restaurant/restaurant’;
import { LogoutPage } from ‘…/pages/logout/logout’;
import { NavController } from ‘ionic-angular’;

@Component({
templateUrl: ‘app.html’
})
export class MyApp {
@ViewChild(Nav) nav: Nav;

deviceid: any;
tokenurl: any;
rootPage = SlidingPage;
serverurl: any;
page: Array<{title: string, component: any, isVisible: boolean}>;
hotels: any;

// constructor(public platform: Platform, public statusBar: StatusBar, public splashScreen: SplashScreen, public alertCtrl: AlertController, private fcm: FCM, public apiProvider: ApiProvider)

constructor(public platform: Platform, public statusBar: StatusBar, public splashScreen: SplashScreen, public alertCtrl: AlertController, private fcm: FCM, public apiProvider: ApiProvider)
{
this.serverurl = this.apiProvider.getServerUrl();
this.initializeApp();
this.apiProvider.data();

// used for an example of ngFor and navigation
this.apiProvider.data.subscribe(data => {
this.page = [
  { title: 'Profile', component: ProfilePage, isVisible: true },
  { title: 'Venetian Village', component: MaintabsPage, isVisible: true },
  // { title: 'Restaurants', component: SubtabsPage },
  { title: 'My Bookings', component: MybookingsPage , isVisible: true },
  { title: 'My Offers', component: MyoffersPage , isVisible: true },
  { title: 'My Messages', component: MymessagesPage, isVisible: true  },
  // { title: 'Settings', component: SettingsPage },

  //  {title:'EventdetailsPage', component: EventdetailsPage},

];

});
}

public initializeApp() {
console.log(“initializeApp function”);
this.platform.ready().then(() => {
// Okay, so the platform is ready and our plugins are available.
// Here you can do any higher level native things you might need.
this.initializeFCM();
this.statusBar.styleDefault();
this.splashScreen.hide();
});
}

public initializeFCM() {
console.log(“Initialized FCM”);
this.fcm.subscribeToTopic(‘all’);

this.fcm.getToken().then(token => {
  this.registerToken(token);
});

this.fcm.onNotification().subscribe(data => {

  //Notification Display Section
  let confirmAlert = this.alertCtrl.create({
    title: data.title,
    message: data.message,
    buttons: [{
      text: 'Ignore',
      role: 'cancel'
    }, {
      text: 'Show It',
      handler: () => {
        console.log("Hanlde notification action such as redirecting to My Offers page");
        //TODO: Your logic here
        //self.nav.push(DetailsPage, {message: data.message});
        this.nav.setRoot(MyoffersPage);
        //this.navCtrl.setRoot(MyoffersPage);
      }
    }]
  });

  confirmAlert.present();

  if (data.wasTapped) {
    console.info("Received in background");
  } else {
    console.info("Received in foreground");
  };
});

this.fcm.onTokenRefresh().subscribe(token => {
  this.registerToken(token);
});

//fcm.unsubscribeFromTopic('all');

}

public registerToken(token: string) {
this.deviceid = this.apiProvider.getDeviceId();

this.tokenurl = 'push/savetoken.php?userid=1&devid=' + this.deviceid + '&token=' + token;

console.log("Tokenurl, device id:" + this.tokenurl + "," + this.deviceid.uuid);

this.apiProvider.doGetAdv(this.tokenurl, null, null)
  .then(data => {
    console.log(JSON.stringify(data));
    //this.tokenresponse = data;
    console.log(JSON.stringify(data));
    //alert(JSON.stringify(data));
  });

}