locked
Deploying HttpClient - NameResolutionFailure - only on iOS device RRS feed

  • Question

  • User371278 posted

    Hi All,

    I'm having an issue with httpClient, but only on my iOS device (I've not checked Android but I'm not targeting it), it works well in the emulator.

    When my app loads the ViewModels do a API call to try and get data from my server and I almost immediately get a System.Net.WebException: Error: NameResolutionFailure crash. I don't get this in the iOS emulator for the same API call.

    I tried calling https://jsonplaceholder.typicode.com/posts which I know works and rules out anything idiosyncratic bugs in my code but it still fails.

    Is there anything special I need to do enable internet access on an iOS device? Could I have set up something wrong in my provisioning profile in the Apple Account?

    Thanks in advance

    Wednesday, December 26, 2018 5:51 PM

Answers

  • User371278 posted

    Doi I found the problem, it was some code I was calling to register for push notifications (which I still need to debug) but due to the async nature the debugger had moved onto that (the next executable line) while the screen was still in the HTTP client code

    Thanks for the help, knowing that there isn't some special permission needed for iOS devices helped

    • Marked as answer by Anonymous Thursday, June 3, 2021 12:00 AM
    Friday, December 28, 2018 12:33 PM

All replies

  • User167259 posted

    If you could post some sample code or a demo project of the issue that would help a lot more in getting a resolution. Off the top of my head I can't think of any causes for the issue you described.

    Wednesday, December 26, 2018 6:41 PM
  • User198446 posted

    Have you managed info.plist?

    https://stackoverflow.com/questions/31254725/transport-security-has-blocked-a-cleartext-http

    Thursday, December 27, 2018 12:03 AM
  • User369978 posted

    As mentioned here , try to disable TLS .

    You can find solution by the referring link AndreiMisiukevivh provided.

    Thursday, December 27, 2018 5:15 AM
  • User371278 posted

    Thanks for the comments, I don't want to disable TLS, as both APIs I'm trying to access are TLS1.2, as I say it works fine on my simulator.

    I'm presuming though that for everyone else, it just works when you deploy to a device and you don't need to do anything special, i.e. I've not missed some magic checkbox!

    I'll try creating a dummy app as I guess its something strange in my code

    Thursday, December 27, 2018 8:20 AM
  • User371278 posted

    Doi I found the problem, it was some code I was calling to register for push notifications (which I still need to debug) but due to the async nature the debugger had moved onto that (the next executable line) while the screen was still in the HTTP client code

    Thanks for the help, knowing that there isn't some special permission needed for iOS devices helped

    • Marked as answer by Anonymous Thursday, June 3, 2021 12:00 AM
    Friday, December 28, 2018 12:33 PM
  • User369978 posted

    @ChrisAllison12 said: Doi I found the problem, it was some code I was calling to register for push notifications (which I still need to debug) but due to the async nature the debugger had moved onto that (the next executable line) while the screen was still in the HTTP client code

    Thanks for the help, knowing that there isn't some special permission needed for iOS devices helped

    Can you mark it as answer if this issue has been solved ?

    Monday, December 31, 2018 1:31 AM