Methods missing in NSUrlConnectionDelegate

CheesebaronCheesebaron DKInsider, University mod

I am in the middle of migrating libraries to the Unified API, most stuff translates very easily. However, now I am hitting a wall.

I have a UIViewController displaying a UIWebView, which is used for logging in with Azure Access Control services. When it hits a certain schema it should parse it and notify back that it got the returned token from ACS, otherwise create a new NSUrlConnection which navigates the NSUrlRequest.

The problem occurs with the NSUrlRequest, which requires an instance of INSUrlConnectionDelegate, where prior to the Unified API I was using NSUrlConnectionDelegate.

Udating my library to Unified API a couple of methods I was using before are missing. Namely ReceivedData(NSUrlConnection, NSData) and FinishedLoading(NSUrlConnection). What do I do now?

The code can be seen here, haven't yet pushed the Unified API changes: https://github.com/Cheesebaron/Cheesebaron.MvxPlugins/blob/master/AzureAccessControl/AzureAccessControl.Touch/Views/AccessControlWebAuthController.cs#L131

Best Answer

Answers

  • CheesebaronCheesebaron DKInsider, University mod

    OK, it seems like it has been split into the class NSUrlConnectionDataDelegate. It's great that you are doing this :)

  • RajaArslanRajaArslan USMember

    @Cheesebaron‌ Hi can you please share the details how'd you solve this issue. Code snippet will help. Cheers :)

  • JomsJoms USMember, University

    I need both NSUrlConnectionDelegate and NSUrlConnectionDataDelegate, to cater to authentication challenge and handle the received response. How do I do this now?

  • DaveUDaveU GBMember ✭✭

    @Joms - did you find a way to do this? I only need to handle the response so only actually need to set-up NSUrlConnectionDataDelegate but can't see how to add this to the connection

  • DaveUDaveU GBMember ✭✭

    Sorry, I've realised NSUrlConnectionDataDelegate inherits from NSUrlConnectionDelegate so I can just pass my NSUrlConnectionDataDelegate into the NSUrlConnection, making sure I implement all of the relevant methods

Sign In or Register to comment.