What to pass as parameter in permission while integrating vk ios sdk in ios app?

1.2k views Asked by At

I am working on a iphone application where i have to integrate vk.com russian social networking site. I have integrated the vk iOS SDKs downloaded from Github. In below method I passed the my application id as app id but I’m a bit confused about the permission parameter. I have searched through lot of sites including the vk developer site but was unable to find solution what to pass as permission parameter.

"[VKSession openSessionWithAppId:APP_ID permissions:PERMISSIONS handler:^(NSError *error)"

While i am executing my app i am getting the Error as follows:

Error Domain=NSURLErrorDomain 
  Code=-999 "The operation couldn’t be completed. (NSURLErrorDomain error -999.)"
  UserInfo=0x6e7d980 {NSErrorFailingURLKey=https://oauth.vk.com/authorize?client_id=4069809&scope=friends&redirect_uri=https://oauth.vk.com/blank.html&display=touch&response_type=token, NSErrorFailingURLStringKey=https://oauth.vk.com/authorize?client_id=4069809&scope=friends&redirect_uri=https://oauth.vk.com/blank.html&display=touch&response_type=token}
3

There are 3 answers

0
Ranjan Sahu On BEST ANSWER

In the permissions user have to pass the details he want to use the login users like @"EmailId,,FriendList,Profile Details".

0
kudinovdenis On

You can use constants listed in VKPermissions.h

NSString *const VK_PER_NOTIFY = @"notify";
NSString *const VK_PER_FRIENDS = @"friends";
NSString *const VK_PER_PHOTOS = @"photos";
NSString *const VK_PER_AUDIO = @"audio";
NSString *const VK_PER_VIDEO = @"video";
NSString *const VK_PER_DOCS = @"docs";
NSString *const VK_PER_NOTES = @"notes";
NSString *const VK_PER_PAGES = @"pages";
NSString *const VK_PER_STATUS = @"status";
NSString *const VK_PER_WALL = @"wall";
NSString *const VK_PER_GROUPS = @"groups";
NSString *const VK_PER_MESSAGES = @"messages";
NSString *const VK_PER_NOTIFICATIONS = @"notifications";
NSString *const VK_PER_STATS = @"stats";
NSString *const VK_PER_ADS = @"ads";
NSString *const VK_PER_OFFLINE = @"offline";
NSString *const VK_PER_NOHTTPS = @"nohttps";
NSString *const VK_PER_EMAIL = @"email";

like this

[VKSdk authorize:@[VK_PER_EMAIL, VK_PER_FRIENDS, VK_PER_MESSAGES] revokeAccess:YES forceOAuth:NO inApp:YES];