When an instance of this class is created it then can be passed as a parameter to other classes which are initialized using initWithtransport
: method.
Once sign-in request is successful, the instance of VPNUTransport
manages the created session internally. Therefore, all subsequent requests should be made using the same instance of VPNUTransport
.
If you use the standard authorization routine with authorizeWithLogin
: method of VPNUAuthorizer
class, VPNUTransport
silently re-authorizes if the session is expired. But if you implement non-standard authorization methods (like authorizing with social networks), it is impossible to re-authorize without calling the third-party code. In this case you must implement methods from VPNUAuthDelegateProtocol
and pass the delegate instance to customAuthDelegate
property before any usage of this class.
Extends: NSObject
Declared in: VPNUTransport.h
- (void)cancelAllRequests;
- (id)sendRequest:(VPNURequest *)request error:(NSError **)error;
nil
.nil
.An arbitrary object which represents a server response if no error has occured. Can be nil
.
This method sends a previously created instance of VPNURequest
synchronously and waits for the response. It blocks a calling thread.
This method shouldn't be called from main thread.
Available in Mac OS X v10.7. Available in iOS v7.0.
+ (void)setSharedTransport:(VPNUTransport *)transport;
VPNUTransport
instance to a specified transport object.An application that has special transporting requirements or constraints should use this method to specify an VPNUTransport
instance with customized settings. The application should do so before any calls to the sharedTransport method.
Available in Mac OS X v10.7. Available in iOS v7.0.
+ (VPNUTransport *)sharedTransport;
VPNUTransport
instance.The shared VPNUTransport
instance.
Applications that do not have special transporting requirements or constraints should find the default shared transport instance acceptable. An application with more specific needs can create a custom VPNUTransport
object and set it as the shared transport instance using setSharedTransport
:. The application should do so before any calls to this method.
Available in Mac OS X v10.7. Available in iOS v7.0.
@property (strong) id<VPNUAuthDelegateProtocol> customAuthDelegate;
A delegate object which conforms to VPNUAuthDelegateProtocol
protocol.
Once you define an object which conforms to VPNUAuthDelegateProtocol
, set this property with it. If you are using non-standard authorization methods (like authorizing with social networks), you must provide an object which resolves custom authorization with third-party server and returns authentication details.
Available in Mac OS X v10.7. Available in iOS v7.0.