Ionic Native HTTP does not work for Anroid 9 (Pie) and up?

后端 未结 2 1362
执笔经年
执笔经年 2020-12-19 05:57

I\'ve created an app that connects successfully to our server using Ionic Native HTTP, testing it with Samsung Galaxy J7 Prime OS version Marshmallow and several others that

2条回答
  •  無奈伤痛
    2020-12-19 06:18

    Android P requires HTTPS by default. What this means is that if you are using unencrypted HTTP requests in your app, the app will work fine in all lower versions than Android P.

    To avoid this security exception, try below changes in your app code.

    In AndroidManifest.xml

    
    
        
            ...
        
    
    

    and in res/xml add file named : network_security_config.xml

    network_security_config.xml

    
    
        
            //  Add host of your download URL in below line. 
            //   ie. if url is  "https://www.google.com/search?source=...."
            //   then just add "www.google.com"
            www.google.com
        
    
    

提交回复
热议问题