How to navigate specific page, when click back button on navbar in ios


I am try to navigate the page when pressed the back button of navbar for ios and android.

I tried below code, but it works with android hardware button only.

    constructor(public navCtrl: NavController, public navParams: NavParams, private viewCtrl:ViewController, private platformCtrl:Platform) {

     platformCtrl.registerBackButtonAction(() => {


I tried this also but this are not forking

   console.log('back clicked');
   console.log('back clicked');

can any one please help me how to listen back button click