window.sqlitePlugin is undefined on iOS platfrorm. Ionic 5 app

Could anyone suggest please, what is going wrong ? I use such code. On Android platform everything is ok but on iOS win.sqlitePlugin is undefined.

  const win: any = window;

  document.addEventListener('deviceready', function() {
        this._db = win.sqlitePlugin.openDatabase({
          name: DB_NAME,
          location: 2,
          createFromLocation: 0
        });
           });


error TS2339: Property 'sqlitePlugin' does not exist on type 'Window'.

[Error] ERROR – Error: Uncaught (in promise): TypeError: undefined is not an object (evaluating 'win.sqlitePlugin.openDatabase')
app://localhost/main-es2015.js:14624:40

Mm, do you have the plugin installed?

Can you share a small sample project?

Problem solved,thanks.

Hi Anton, how did you solved it?