NathanWalker / angular-seed-advanced

Advanced Angular seed project with support for ngrx/store, ngrx/effects, ngx-translate, angulartics2, lodash, NativeScript (*native* mobile), Electron (Mac, Windows and Linux desktop) and more.
MIT License
2.26k stars 451 forks source link

enabling cors from nativescript-angular app #462

Open mu250234 opened 6 years ago

mu250234 commented 6 years ago

Hi, I have an issue with cors (cross domain )request . I need to fetch data from rest api which are deployed on other domain from my nativescript angular app. Is there any way to enable cors in nativescript app ? (like we can use "Allow-Control-Allow-Origin: *" plugin for Chrome) . Please don't suggest me to enable cors from server side as I don't have permissions.

fourctv commented 6 years ago

For iOS you need to add the following to /nativescript/App_Resources/iOS/info.plist:

    <key>NSAppTransportSecurity</key>
    <dict>
        <!--Include to allow all connections (DANGER)-->
        <key>NSAllowsArbitraryLoads</key>
        <true/>
    </dict>

Not sure what is the similar setting for Android.

kokosky93 commented 4 years ago

How to do this on for Android?