$ionicPlatform.registerBackButtonAction event is not working for me in my mobile App

Please suggest me


Can you give some more information? Where do you have the code at? What are you trying to do?

Here’s an example in the$ionicPlatform, $state) {
    // Override the android back button
    $ionicPlatform.registerBackButtonAction(function () {
        if ($ == "home") {
            // do something for this state
        } else {
    }, 100);


var appstarter = angular.module(‘starter’, [‘ionic’, ‘starter.controllers’]) ($ionicPlatform, $ionicHistory) {
$ionicPlatform.ready(function () {
// Hide the accessory bar by default (remove this to show the accessory bar above the keyboard
// for form inputs)
if (window.cordova && window.cordova.plugins.Keyboard) {
if (window.StatusBar) {
// org.apache.cordova.statusbar required

$ionicPlatform.registerBackButtonAction(function (event) {
}, 100);


This is my code in app.js I want to restrict android back button but this event is not firing.

1 Like

Hey, even i have the same problem… did you get it resolved???


I am having the same problem. I want to clear history when I tap to a tab. So I want to use registerBackButtonAction to handle this. But I am not able to get registerBackButtonAction worked.

What am I doing wrong? Is there anyone solved this issue?

Thanks in advance.

Hi! I worked most of the solutions until I added the plugin InAppBrowser, now I stopped working. What could be the problem? :expressionless:

Hey, Anyone found solution for this? I am also facing the same issue.