Fiddler - Xamarin Forms - 本地 Azure 后端 - iOS 模拟器

Fiddler - Xamarin Forms - Local Azure Backend - iOS simulator

我有:

我正在 PC 上的 Xamarin iOS 模拟器上调试 Xamarin Forms 应用程序。

当我在 Xamarin iOS 模拟器的 Safari 浏览器中浏览时,Fiddler 捕获了它。但是,当我的应用程序向我的本地后端(HTTP 而不是 HTTPS)发出一些请求时,我看不到它们。如果我在 Windows 模拟器中 运行 应用程序,请求将被捕获。

我是不是漏了一步?

我遇到了同样的问题,但是创建了一个代理 class 作为 Felix Collins 在下一个 post 中的回答帮助我。

https://forums.xamarin.com/discussion/24411/how-can-i-inspect-my-xamarin-forms-apps-network-traffic

希望对你也有帮助。

我现在可以将 Fiddler 与 Azure 移动应用程序、Xamarin 和 ios tks 一起使用到 @user6581605 以及这个 post: https://shellmonger.com/2016/06/23/using-modernhttpclient-with-azure-mobile-apps/

我从 Paul Betts 安装了 modernhttpclient nuget: https://www.nuget.org/packages/modernhttpclient/

然后我以这种方式实例化我的 MobilerServiceClient:

var client = new MobileServiceClient("https://mysite.azurewebsites.net",
    new ModernHttpClient.NativeMessageHandler());

完成更新info.plist
<key>NSAppTransportSecurity</key>
    <dict>
        <key>NSAllowsArbitraryLoads</key>
        <true/>
        <key>NSExceptionDomains</key>
        <dict>
            <key>yourdomain.com</key>
            <dict>
                <key>NSIncludesSubdomains</key>
                <true/>
                <key>NSThirdPartyExceptionRequiresForwardSecrecy</key>
                <false/>
            </dict>
       </dict>
  </dict>