VKSdk Class Reference
| Inherits from | NSObject | 
|---|---|
| Declared in | VKSdk.h VKSdk.m | 
Delegate
  currentAppId
	Returns a last app_id used for initializing the SDK
@property (nonatomic, readonly, copy) NSString *currentAppIdDiscussion
Returns a last app_id used for initializing the SDK
Declared In
VKSdk.h
  apiVersion
	API version for making requests
@property (nonatomic, readonly, copy) NSString *apiVersionDiscussion
API version for making requests
Declared In
VKSdk.h
Initialization
+ instance
	Returns instance of VK sdk. You should never use that directly
+ (instancetype)instanceDiscussion
Returns instance of VK sdk. You should never use that directly
Declared In
VKSdk.h
+ initialized
	Returns YES if SDK was previously initialized with initializeWithAppId: method
+ (BOOL)initializedDiscussion
Returns YES if SDK was previously initialized with initializeWithAppId: method
Declared In
VKSdk.h
+ initializeWithAppId:
	Initialize SDK with responder for global SDK events with default api version from VK_SDK_API_VERSION
+ (instancetype)initializeWithAppId:(NSString *)appIdParameters
| appId | your application id (if you haven’t, you can create standalone application here https://vk.com/editapp?act=create ) | 
|---|
Discussion
Initialize SDK with responder for global SDK events with default api version from VK_SDK_API_VERSION
Declared In
VKSdk.h
+ initializeWithAppId:apiVersion:
	Initialize SDK with responder for global SDK events
+ (instancetype)initializeWithAppId:(NSString *)appId apiVersion:(NSString *)versionParameters
| appId | your application id (if you haven’t, you can create standalone application here https://vk.com/editapp?act=create ) | 
|---|---|
| apiVersion | if you want to use latest API version, pass required version here | 
Discussion
Initialize SDK with responder for global SDK events
Declared In
VKSdk.h
– registerDelegate:
	Adds a weak object reference to an object implementing the VKSdkDelegate protocol
- (void)registerDelegate:(id<VKSdkDelegate>)delegateDiscussion
Adds a weak object reference to an object implementing the VKSdkDelegate protocol
Declared In
VKSdk.h
– unregisterDelegate:
	Removes an object reference SDK delegate
- (void)unregisterDelegate:(id<VKSdkDelegate>)delegateDiscussion
Removes an object reference SDK delegate
Declared In
VKSdk.h
Authentication in VK
+ authorize:
	Starts authorization process to retrieve unlimited token. If VKapp is available in system, it will opens and requests access from user. Otherwise Mobile Safari will be opened for access request.
+ (void)authorize:(NSArray *)permissionsParameters
| permissions | array of permissions for your applications. All permissions you can | 
|---|
Discussion
Starts authorization process to retrieve unlimited token. If VKapp is available in system, it will opens and requests access from user. Otherwise Mobile Safari will be opened for access request.
Declared In
VKSdk.h
+ authorize:withOptions:
	Starts authorization process. If VKapp is available in system, it will opens and requests access from user. Otherwise Mobile Safari will be opened for access request.
+ (void)authorize:(NSArray *)permissions withOptions:(VKAuthorizationOptions)optionsParameters
| permissions | array of permissions for your applications. All permissions you can | 
|---|---|
| options | special options | 
Discussion
Starts authorization process. If VKapp is available in system, it will opens and requests access from user. Otherwise Mobile Safari will be opened for access request.
Declared In
VKSdk.h
Access token methods
+ accessToken
	Returns token for API requests
+ (VKAccessToken *)accessTokenReturn Value
Received access token or nil, if user not yet authorized
Discussion
Returns token for API requests
Declared In
VKSdk.h
Other methods
+ processOpenURL:fromApplication:
	Checks passed URL for access token
+ (BOOL)processOpenURL:(NSURL *)passedUrl fromApplication:(NSString *)sourceApplicationParameters
| passedUrl | url from external application | 
|---|---|
| sourceApplication | source application | 
Return Value
YES if parsed successfully
Discussion
Checks passed URL for access token
Declared In
VKSdk.h
+ isLoggedIn
	Checks if somebody logged in with SDK (call after wakeUpSession)
+ (BOOL)isLoggedInDiscussion
Checks if somebody logged in with SDK (call after wakeUpSession)
Declared In
VKSdk.h
+ wakeUpSession:completeBlock:
	This method is trying to retrieve token from storage, and check application still permitted to use user access token
+ (void)wakeUpSession:(NSArray *)permissions completeBlock:(void ( ^ ) ( VKAuthorizationState , NSError *))wakeUpBlockDiscussion
This method is trying to retrieve token from storage, and check application still permitted to use user access token
Declared In
VKSdk.h
+ forceLogout
	Forces logout using OAuth (with VKAuthorizeController). Removes all cookies for *.vk.com. Has no effect for logout in VK app
+ (void)forceLogoutDiscussion
Forces logout using OAuth (with VKAuthorizeController). Removes all cookies for *.vk.com. Has no effect for logout in VK app
Declared In
VKSdk.h
+ vkAppMayExists
	Checks if there is some application, which may process authorize url
+ (BOOL)vkAppMayExistsDiscussion
Checks if there is some application, which may process authorize url
Declared In
VKSdk.h
– hasPermissions:
	Check existing permissions
- (BOOL)hasPermissions:(NSArray *)permissionsParameters
| permissions | array of permissions you want to check | 
|---|
Discussion
Check existing permissions
Declared In
VKSdk.h
+ setSchedulerEnabled:
	Enables or disables scheduling for requests
+ (void)setSchedulerEnabled:(BOOL)enabledDiscussion
Enables or disables scheduling for requests
Declared In
VKSdk.h