I developed ionic application and angular (ionic 6 and angular 15), I use awesome-cordova-plugins/sqlite and cordova-sqlite-storage for create database sqlite, now I test application with my phone android and i use edge inspect device for debug application , now when I launch page for get data from sqlite It return this error .
enter image description here
code ts for component:
private dbName: string = '';
public static connection: Connection;
this.searchProvider.getDistricts().subscribe(
(res: any) => {
console.log("res getDistricts")
console.log(res)
},
(error: any) => {
console.log(error);
}
);
code ts search service:
public getDistricts(): Observable<any> {
return this.databaseProvider.getDistricts().pipe(
map(
(res: any) => {
return res;
},
catchError((error: any) => {
return throwError(error);
})
)
);
}
code provider:
public getDistricts() : Observable<any> {
let db = new SQLite();
return from(
db.create({
name: this.dbName,
location: "default"
}).then((connexion: SQLiteObject) => {
return connexion
.executeSql("SELECT * FROM district ORDER BY name", [])
.then((data: any) => {
return data;
})
.catch((err: any) => console.log(err))
}).catch((e: any) => console.log(e))
);
}
I test my application in device android and i debug in edge inspect device, I search in internet and I found cordova doesn’t work with browser, but in my case I test with device android