I am developing an ionic app. In my android build when I click the hardware back button it shows a white blank screen when I double click it, goes back to the previous screen perfectly. I don’t have problems with the back button in the screen. The problem is with the hardware back button. Please help.
any console errors on the hardware back button?
Hi,
No, I don’t see any errors.
Have you registered some action on the backbutton event like
$ionicPlatform.registerBackButtonAction(function () {
if (condition) {
} else {
handle back action!
}
}, 100);
Hi,
Yes. I have registered
Remove that and see if it works
No its not working,
function showReportPage() {
if (reportId != id) {
return;
}
onMap && map.deactivate();
createReportElement();
element.addClass('ng-enter ng-enter-active active')
.removeClass('ng-leave ng-leave-active');
// on iOS, clicks will sometimes bleed through/ghost click on underlying elements
$ionicClickBlock.show(600);
deregisterBackButtonAction = $ionicPlatform.registerBackButtonAction(onBack, 1000);
onMap && $timeout(function () {
parentScope.showReport && cordovaPlugin.statusBar.show();
}, 100);
reportReadsService.registerReportRead(reportId, new Date());
}
}
{
“name”: “”,
“version”: “1.0.0”,
“description”: “Mobile App”,
“license”: “UNLICENSED”,
“repository”: {},
“scripts”: {
“ios.dev.s”: “gulp deploy -p -s s; cp -rf www platforms/ios/”,
“ios.dev”: “gulp deploy -p; cp -rf www platforms/ios/”,
“android.dev.s”: “gulp deploy -p -s s; cp -rf www platforms/android/assets/”,
“android.dev”: “gulp deploy -p; cp -rf www platforms/android/assets/”
},
“dependencies”: {
"@types/angular": “^1.5.11”,
"@types/angular-mocks": “^1.5.2”,
"@types/angular-translate": “^2.4.31”,
"@types/angular-ui-router": “^1.1.32”,
"@types/cordova": “0.0.30”,
"@types/ionic": “0.0.29”,
"@types/jasmine": “^2.2.31”,
"@types/leaflet": “^1.0.29”,
"@types/lodash": “^4.14.31”,
"@types/mapbox": “^1.6.27”,
“colors”: “^1.1.2”,
“del”: “^2.2.2”,
“gulp”: “^3.9.1”,
“gulp-concat”: “^2.6.0”,
“gulp-if”: “^2.0.1”,
“gulp-inject”: “^4.1.0”,
“gulp-minify-css”: “^1.2.4”,
“gulp-ng-annotate”: “^2.0.0”,
“gulp-rename”: “^1.2.2”,
“gulp-sass”: “^2.3.2”,
“gulp-sourcemaps”: “^1.6.0”,
“gulp-template”: “^4.0.0”,
“gulp-typescript”: “^2.13.6”,
“gulp-uglify”: “^2.0.0”,
“gulp-util”: “^3.0.7”,
“jasmine-core”: “^2.4.1”,
“karma”: “^1.2.0”,
“karma-babel-preprocessor”: “^6.0.1”,
“karma-coverage”: “^1.1.1”,
“karma-jasmine”: “^1.0.2”,
“karma-ng-html2js-preprocessor”: “^1.0.0”,
“karma-phantomjs-launcher”: “^1.0.1”,
“lodash”: “^4.15.0”,
“minimist”: “^1.2.0”,
“phantomjs-prebuilt”: “^2.1.12”,
“prompt”: “^1.0.0”,
“pump”: “^1.0.1”,
“shelljs”: “^0.7.3”,
“through2”: “^2.0.1”,
“typescript”: “^2.0.0”,
“xcode”: “^0.8.9”
},
“cordovaPlugins”: [
“cordova-plugin-camera”,
“cordova-plugin-console”,
“cordova-plugin-device”,
“cordova-plugin-file”,
“cordova-plugin-file-transfer@1.5.1”,
“cordova-plugin-geolocation”,
“cordova-plugin-inappbrowser”,
“cordova-plugin-network-information”,
“cordova-plugin-splashscreen”,
“cordova-plugin-statusbar”,
“cordova-plugin-whitelist”,
“ionic-plugin-keyboard”,
{
“locator”: “https://github.com/katzer/cordova-plugin-badge.git”,
“id”: “cordova-plugin-badge”
},
{
“locator”: “plugins-src/thundermaps-cordova”,
“id”: “thundermaps-cordova”
},
“cordova-plugin-social-message”
],
“cordovaPlatforms”: [
“android”,
“ios”
]
}
i was saying to remove all the back button event handlers to let ionic handle it by default
Secondly, is it happennin only for 1 view or for all of them.
not for all only few views.
actually the side menu is not closed. If I double tap the hardware back, it works
i have same problem in iPhones only am getting white screen on back button navigation tried with $timeout it did not help . Here is my environment on iOS.
I am using ionic v1
cli packages:
@ionic/cli-utils : 1.8.1
ionic (Ionic CLI) : 3.8.1
global packages:
Cordova CLI : 7.0.1
local packages:
Cordova Platforms : ios 4.4.0
Ionic Framework : unknown
System:
ios-deploy : 1.9.1
ios-sim : 5.0.8
Node : v6.10.3
npm : 3.10.10
OS : macOS Sierra
Xcode : Xcode 8.3.2 Build version 8E2002
am unable to see any white screen on android.
can someone give me solutions on it, i have tried most of the solutions none have worked…