I'm currently working on an Ionic 4 Application (Angular) available for Windows 10 (UWP).
I would like to hide the arrow back :
I tried these solutions, in my app.component constructor with initializeApp() : How to hide/remove Ionic 4 Cordova Windows 10 app back button?
But nothing is working, I also tried to use in ionViewDidEnter and also in the first page in my app with a 5 seconds timeout.
The method to Windows.core is called after everything is loaded. My app.component.ts is routed via tabs to my authentication page.
app.component.ts
constructor(
...
) {
this.initializeApp();
this.setLanguageSettings();
}
private async initializeApp() {
await this.platform.ready();
if (this.platform.is('cordova') && cordova.platformId === 'windows') {
setTimeout(() => this.hideWindowsTitleBackArrow(), 1000);
}
private hideWindowsTitleBackArrow(): void {
console.log('hiding-first');
try {
const w: any = window;
if (w.cordova.platformId === 'windows') {
const currentView = w.Windows.UI.Core.SystemNavigationManager.getForCurrentView();
currentView.AppViewBackButtonVisibility =
w.Windows.UI.Core.AppViewBackButtonVisibility.collapsed;
}
} catch (error) {
console.error(`Error in hideWindowsTitleBackArrow: ${error}`);
}
}
Ionic info :
ionic info
Ionic:
Ionic CLI : 5.4.6
Ionic Framework : @ionic/angular 4.11.8
@angular-devkit/build-angular : 0.10.7
@angular-devkit/schematics : 7.0.7
@angular/cli : 7.0.7
@ionic/angular-toolkit : 1.5.1
Cordova:
Cordova CLI : 9.0.0 ([email protected])
Cordova Platforms : windows 7.0.0
Cordova Plugins : cordova-plugin-ionic-keyboard 2.1.3, cordova-plugin-ionic-webview 3.1.1, (and 11 other plugins)
Utility:
cordova-res : not installed
native-run : 0.2.9
System:
NodeJS : v10.15.3 (C:\Tools\nodejs\node.exe)
npm : 6.4.1
OS : Windows 10