xamarin / xamarin-macios

.NET for iOS, Mac Catalyst, macOS, and tvOS provide open-source bindings of the Apple SDKs for use with .NET managed languages such as C#
Other
2.44k stars 508 forks source link

Expose an API for session configuration to initialise customised request #3786

Closed prince-datami closed 6 years ago

prince-datami commented 6 years ago

Description of the issue: We have SDK which sponsors mobile data on the ios device. We intercept the read and write request made by the app to sponsor data. While Creating the DLL for native binding, we are facing the issue that read and write requests for the app are not intercepted because xamarin uses web client which is not exposed or does not expose any API to initialize the session.

Steps to Reproduce

  1. Create an app which makes network requests.
  2. Try to intercept the request or response before sending it to the app and vice versa.
  3. Our SDK needs to imbibe the first network request made by the app. In xamarin, the same feasibility is achieved by using WebClient which needs to expose an API to initialize the request/ session.

Expected Behavior

Once we have the API to configure the request made by the app, we can use our solution to bind the network calls.

Actual Behavior

There is no way we can intercept the request, Xamarin has its own wrapper over the NSURLSession which takes care of the network request. It needs to expose one such API which will allow us to intercept the request.

Environment

iOS.

The code is a framework solution, We can provide the DLL if needed. 

Build Logs

Example Project (If Possible)

mandel-macaque commented 6 years ago

Hello, can you please provide the dll or a small sample for me to test the issue. That would greatly help me confirm it.

therealjohn commented 6 years ago

We have not received the requested information. If you are still experiencing this issue please provide all the requested information then click the Reopen Issue button. Thanks!