TeamMaestro / angular-native-seed

Build web apps and NativeScript applications from one codebase using the AngularCLI.
265 stars 71 forks source link

{N} and localhost #58

Closed makeAdance closed 7 years ago

makeAdance commented 7 years ago

How can I achieve that a http-request to http://localhost:3000/example is working? I assume the problem occurs because you make no request to https !?!

After npm run ios and the request I get the following error:

App Transport Security has blocked a cleartext HTTP (http://) resource load since it is insecure. Temporary exceptions can be configured via your app's Info.plist file.
CONSOLE ERROR file:///app/tns_modules/@angular/core/./bundles/core.umd.js:1052:24: ERROR Error: Uncaught (in promise): Response with status: 200  for URL: null

I would like to know the best/correct approach to solve that problem. (both for ios/android) Thanks.

sean-perkins commented 7 years ago

I would like to friendly remind you that the git issue tracking on this repository is focused solely on issues with the seed, the tooling tasks or dependency conflicts.

This is not meant to and does not operate as a forum board for support on your NativeScript projects.

Those appropriate channels are:

A simple Google search of your error would provide 61,000+ results on relative topics that point out the exact procedure to resolving this issue.

The first Google result is this StackOverflow issue: https://stackoverflow.com/questions/31254725/transport-security-has-blocked-a-cleartext-http

makeAdance commented 7 years ago

I understand. Sorry. I will keep that in mind for the future. Maybe you were to helpful; that`s why I kept asking. Of course I made a GoogleSearch and I found the side you referenced; but I thought that you might know it better. Never mind; I am sorry and I appreciate your help. Thanks for your time and the helpful links.

On 12 Oct 2017, at 03:39, Sean Perkins notifications@github.com wrote:

I would like to friendly remind you that the git issue tracking on this repository is focused solely on issues with the seed, the tooling tasks or dependency conflicts.

This is not meant to and does not operate as a forum board for support on your NativeScript projects.

Those appropriate channels are:

StackOverflow https://stackoverflow.com/ NativeScript Forums https://discourse.nativescript.org/ NativeScript Slack https://nativescriptcommunity.slack.com/messages/general/ NativeScript Github Issues https://github.com/NativeScript A simple Google search of your error would provide 61,000+ results on relative topics that point out the exact procedure to resolving this issue.

The first Google result is this StackOverflow issue: https://stackoverflow.com/questions/31254725/transport-security-has-blocked-a-cleartext-http https://stackoverflow.com/questions/31254725/transport-security-has-blocked-a-cleartext-http — You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/TeamMaestro/angular-native-seed/issues/58#issuecomment-335995443, or mute the thread https://github.com/notifications/unsubscribe-auth/AZYPf_iY1ky-NcUgwY1GFIl-ERf1ti-Uks5srW3vgaJpZM4P2V4h.

sean-perkins commented 7 years ago

No worries, just want to keep the issue tracking clean and focused as others are tracing problems they encounter with the seed.

You should only need this:

<key>NSAppTransportSecurity</key>
<dict>
  <key>NSAllowsArbitraryLoads</key>
      <true/>
</dict>

in your info.plist and possibly remove and re-add the iOS platform. Android may not have the same security restriction out of the gate.