Hi, community!
How get assets local on capacitor/ios with HttpClient Angular?
URL in image
Environment:
- Capacitor 5
- Angular 16
public myGet(
url: string,
hideLoader = false,
errorHandler?: (err: any, caught: Observable<any>) => ObservableInput<{}>,
responsive = null
): Observable<any> {
if (!hideLoader) {
this.events.publish('loading:start');
}
return this.httpClient.get(url, options).pipe(
map((response) => response),
catchError(errorHandler ? errorHandler : this.handleError),
finalize(() => {
if (!hideLoader) {
this.events.publish('loading:finish');
}
})
);
In Web && Android This working fine!
I’m Try transform url adding: capacitor://localhost:/assets…, but notworking
Try Using CapacitorHttp but have this errors:
CapacitorConfig:
const config: CapacitorConfig = {
appId: 'example.app',
appName: 'App',
webDir: '../../dist/apps/app',
server: {
cleartext: true
},
bundledWebRuntime: false,
plugins: {
CapacitorCookies: {
enabled: true
},
CapacitorHttp: {
enabled: true
},
PushNotifications: {
presentationOptions: ['badge', 'sound', 'alert']
},
SplashScreen: {
launchShowDuration: 2000,
backgroundColor: '#79c000',
showSpinner: false,
splashFullScreen: true,
splashImmersive: true
// layoutName: "launch_screen",
// useDialog: true
}
}
};