Writefile not working

Hello Everybody,
I am new to working with Ionic and I need help.
My code is still not working.

I would like to save data in a Datafile.

My first step:
$ ionic cordova plugin add cordova-plugin-file
$ npm install --save @ionic-native/file

In app module.ts
providers: [
{provide: ErrorHandler, useClass: IonicErrorHandler},

After that in mitglied.ts
import { File } from ‘@ionic-native/file’;

constructor(public navCtrl: NavController, public navParams: NavParams, private alertCtrl: AlertController, public file: File) {

My method

this.file.writeFile(this.file.externalRootDirectory, ‘mydir.txt’, ‘Test’ ,{ replace: false, append: true });


Thank you for your support :wink: