Ion structure and imgcache angularjs not working on iOS device

I created a hybrid ion-skeleton application. I used angular imgcache ( https://github.com/jBenes/angular-imgcache.js/tree/master ) to enable caching of images received from an external site.

I am using code like:

<img img-cache ic-src="{{src}}"/> 

It works in the browser (after using "ion feed") on the command line. I tested it in an ionic iOS app. Now I accept xcodeproj, which it creates and distributes it for testing, but the images do not load.

I even added a plugin with a cordon root list and set a metas to allow CORS requests.

Does anyone have any other ideas what the problem is?

+6
source share
2 answers

First, make sure that the img cache is set to manual init ImgCacheProvider.manualInit = true; in your app.config function.

The second step is to call ImgCache.$init() at any time after the deviceready event (in your case, somewhere in the function $ionicPlatform.ready ).

+3
source

If you are not accessing the HTTPS endpoint, it may be useful for you to verify that the security settings of your application are in the .plist file (found in the platforms / ios / {app_name} / {app_name} -Info.plist)

 <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs$ <plist version="1.0"> <dict> ... <key>NSAppTransportSecurity</key> <dict> <key>NSAllowsArbitraryLoads</key> <true/> </dict> </dict> </plist> 

From this resource: Publishing Ionic Angular iOS App - Hidden Steps and Errors.

0
source

Source: https://habr.com/ru/post/988108/


All Articles