Not allowed to load local resource: ionic 3 android

后端 未结 9 1590

I am using ionic 3 android build apk and trying to laod image from file:///storage/emulated/0/data/io.ionic.vdeovalet/cache/image.jpeg


         


        
9条回答
  •  萌比男神i
    2020-12-14 20:19

    When Ionic is used with Capacitor, we can get the correct path of an image or other resource on a native device by:

    import { Capacitor } from '@capacitor/core';
    
    Capacitor.convertFileSrc(filePath); 
    

    https://ionicframework.com/docs/core-concepts/webview

提交回复
热议问题