dotnet / AspNetCore.Docs

Documentation for ASP.NET Core
https://docs.microsoft.com/aspnet/core
Creative Commons Attribution 4.0 International
12.64k stars 25.29k forks source link

Document how to connect from a mobile app to local web app in the same solution #9815

Open Rick-Anderson opened 5 years ago

Rick-Anderson commented 5 years ago

Moved from #3746
@danroth27 wrote:

We should update this article with more detailed steps on how to connect from the mobile app emulator to the web api when both are in the same solution. Ex. with the Android emulator you use IP address 10.0.2.2 and you need to update your IIS Express site bindings to allow the request through. We should also figure out what the steps are for iOS or UWP.

Nov 2019 6K PV

image


Document Details

Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

Rick-Anderson commented 5 years ago

In the past had problems on Windows with VS. I ran into issues with getting the emulators to allow connections to localhost on the host machine. I also remember hitting issues with dealing with HTTPS, where the request fails because the mobile app doesn’t trust the certificate used by web app during development.

. Contacts: Jimmy Garrido

file -> new and add web api backend should add this for you automatically.

For Android you need to toggle a few things to loopback: https://github.com/jamesmontemagno/MotzCodesLive/blob/master/Twitch-SignalRSaturdays/XamChat/XamChat/ViewModel/ChatViewModel.cs#L53-L55

conceptdev commented 5 years ago

Circling back... we got a first-cut article up to help customers get HTTPS connections to local services for testing from Android & iOS emulators/simulators:

https://docs.microsoft.com/en-us/xamarin/cross-platform/deploy-test/connect-to-local-web-services

We've already identified that we could include more specific instructions on configuring IIS Express, so there'll be another update soon.