From 5403c4dd5e1e733651fac53b245235d51a12e32d Mon Sep 17 00:00:00 2001 From: AndrewShmig Date: Fri, 9 Aug 2013 20:16:38 +0400 Subject: [PATCH] [2.7.3] MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit На экране авторизации теперь можно переходить только по ссылкам для смены языка, ни на какие другие страницы доступа нет. --- Project/Project/ASAAppDelegate.m | 4 ++-- Project/Vkontakte-iOS-SDK-v2.0/VKConnector/VKConnector.m | 8 +++++++- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/Project/Project/ASAAppDelegate.m b/Project/Project/ASAAppDelegate.m index fe58ae6..55e8c7d 100644 --- a/Project/Project/ASAAppDelegate.m +++ b/Project/Project/ASAAppDelegate.m @@ -10,13 +10,13 @@ #import "ASAViewController.h" #import "VKAccessToken.h" #import "VKUser.h" -#import "VKStorageItem.h" -#import "VKStorage.h" + static NSString *const kVKAppID = @"3541027"; static NSString *const kVKPermissionsArray = @"photos,friends,wall,audio,video,docs,notes,pages,status,groups,messages"; + @implementation ASAAppDelegate - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions diff --git a/Project/Vkontakte-iOS-SDK-v2.0/VKConnector/VKConnector.m b/Project/Vkontakte-iOS-SDK-v2.0/VKConnector/VKConnector.m index 9cd9abc..3511eed 100644 --- a/Project/Vkontakte-iOS-SDK-v2.0/VKConnector/VKConnector.m +++ b/Project/Vkontakte-iOS-SDK-v2.0/VKConnector/VKConnector.m @@ -110,7 +110,7 @@ - (void)startWithAppID:(NSString *)appID @"redirect_uri" : _redirectURL, @"scope" : _settings, @"response_type" : @"token", - @"display" : @"touch"}; + @"display" : @"mobile"}; NSMutableString *urlAsString = [[NSMutableString alloc] init]; NSMutableArray *urlParams = [[NSMutableArray alloc] init]; @@ -182,6 +182,12 @@ - (BOOL) webView:(UIWebView *)webView [[KGModal sharedInstance] hideAnimated:YES]; } +// разрешаем пользователю только сменить язык в окне авторизации, ничего более + if([url hasPrefix:@"https://vk.com"] || [url hasPrefix:@"http://vk.com"] || + ([url hasPrefix:@"https://m.vk.com"] && ![url hasPrefix:@"https://m.vk.com/settings"])){ + return NO; + } + return YES; }