Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Google-custom-search #529

Open
wants to merge 516 commits into
base: gh-pages
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
516 commits
Select commit Hold shift + click to select a range
550ffa7
Visual improvement in share dialog
RomanTruba Feb 24, 2015
f5cfb8a
Fixed ivar migration
RomanTruba Feb 24, 2015
dda86d5
Updated captcha view
RomanTruba Feb 24, 2015
1869aee
Updated example
RomanTruba Feb 24, 2015
61622c5
Version update
RomanTruba Feb 24, 2015
7ba0790
Framework update
RomanTruba Feb 24, 2015
3433628
Fixed #193. Added requests scheduler.
RomanTruba Mar 20, 2015
934521b
Fixed #186
RomanTruba Mar 20, 2015
f1fe8ec
Fixed #191
RomanTruba Mar 20, 2015
ddbbb5e
Change version to 1.1.1
RomanTruba Mar 20, 2015
01de02e
Update framework
RomanTruba Mar 20, 2015
54e8f1f
Removed log info
RomanTruba Mar 20, 2015
ff93fdb
Remove log info
RomanTruba Mar 20, 2015
02ddaca
Remove log info
RomanTruba Mar 20, 2015
f53cd96
Library code reformat automatically
RomanTruba Mar 20, 2015
1c12244
Version up
RomanTruba Mar 20, 2015
2d7ae8f
Precission fix
RomanTruba Mar 20, 2015
bb1983c
Update framework
RomanTruba Mar 20, 2015
0db68f1
Fixed #194
RomanTruba Mar 23, 2015
8b809e2
Update framework
RomanTruba Mar 23, 2015
17fb34c
Synchronous request cancelation
RomanTruba Mar 23, 2015
6bf4beb
Fixed safari authorize
RomanTruba Mar 23, 2015
66a963d
Fixed example
RomanTruba Mar 23, 2015
a0c4463
Version update
RomanTruba Mar 23, 2015
16ecda8
Refactor
RomanTruba Mar 24, 2015
632212a
Refactor and display in form for ipad
RomanTruba Mar 24, 2015
b018fac
New initialization method. Deprecate unnecessary method. In case of e…
RomanTruba Mar 24, 2015
36ebc1b
Changed building script, removed unnecessary target
RomanTruba Mar 24, 2015
ba639f1
Updated example application
RomanTruba Mar 24, 2015
0bd538e
Updated framework files
RomanTruba Mar 24, 2015
7242be2
Wrong logic in scheduler
RomanTruba Mar 30, 2015
1c23063
Version update
RomanTruba Mar 30, 2015
6c2c3ec
webView -> [urlString hasPrefix] Fix
mihroot Apr 1, 2015
65990a0
fixes for authorization controller
RishatShamsutdinov Apr 2, 2015
88a555c
version bump
RishatShamsutdinov Apr 2, 2015
6629ee2
Merge pull request #196 from mihroot/master
Apr 2, 2015
07a0cb9
Fixed #204, #198, #199
RomanTruba Apr 10, 2015
299f758
Fixed #203
RomanTruba Apr 10, 2015
3f3de5d
Version up
RomanTruba Apr 10, 2015
16d9eeb
Framework update
RomanTruba Apr 10, 2015
6134796
Merged #199
RomanTruba Apr 10, 2015
8be52ac
Updated framework
RomanTruba Apr 10, 2015
648d591
Fixed #195
RomanTruba Apr 27, 2015
46a3f23
Fixed #207
RomanTruba Apr 27, 2015
b0d07d2
Fixed #213
RomanTruba Apr 27, 2015
c98ccfb
Fixed #206
RomanTruba Apr 27, 2015
7689c98
Version updated, project updated
RomanTruba Apr 27, 2015
6a7f084
Ignore file changed
RomanTruba May 6, 2015
da09b3d
Fix serialization of permissions when saving access token
Shulepov May 21, 2015
b4b68c3
fix apiObject for enumeration with ignoredProperties
chasok Jun 20, 2015
75d07fa
add properties of apiObject to enumeration of apiObject
chasok Jun 20, 2015
0e4a7c6
Merge pull request #238 from chasok/apiObjectWithIgnoredFields
Jun 26, 2015
f6be4da
Merge pull request #237 from chasok/apiObjectEnumeration
Jun 26, 2015
40c16bc
Merge branch 'master' of github.com:VKCOM/vk-ios-sdk
RomanTruba Jun 26, 2015
ce7f846
Merge branch 'fix_access_token_serialization' of git://github.com/Shu…
RomanTruba Jun 26, 2015
1dc16b9
Fixed #225
RomanTruba Jun 26, 2015
ee9ff58
Returned project files
RomanTruba Jun 26, 2015
6e3b412
Fixed hardcoded API_VERSION
PitNikola Jun 26, 2015
6cccb55
Providing error if couldn't parse responseString
PitNikola Jun 26, 2015
15012df
Fixed #224
RomanTruba Jun 26, 2015
3169a04
Changed way of providing cancelation
RomanTruba Jun 26, 2015
1fbcb69
Merge branch 'master' of https://github.com/VKCOM/vk-ios-sdk
PitNikola Jun 26, 2015
2db18d7
Fixed #229
RomanTruba Jun 26, 2015
3f7e6e2
Version up
RomanTruba Jun 26, 2015
e90c9f3
Merge branch 'master' of https://github.com/VKCOM/vk-ios-sdk
PitNikola Jun 26, 2015
d05cb3b
Fixed wrong json validation and problem in share dialog
RomanTruba Jun 26, 2015
b1b9f3c
Version up
RomanTruba Jun 26, 2015
2956d98
Fixed #209
RomanTruba Jun 26, 2015
5a0be62
Version up
RomanTruba Jun 26, 2015
23bfb38
Added errorText and json properties to VKError
PitNikola Jul 1, 2015
1f21bfe
Version Up
PitNikola Jul 1, 2015
f5d5f80
Check block param for null
RomanTruba Jul 2, 2015
482e458
Fixed #241
RomanTruba Jul 3, 2015
f67045e
Version up
RomanTruba Jul 3, 2015
4098075
Add prefix to DescriptionForObject function to avoid conflicts
rusik Jul 30, 2015
660d96e
fix warning when deployment target is 8.0 and higher
Aug 7, 2015
a6fee07
Some improvements with parse
RomanTruba Aug 9, 2015
499857b
Merge remote-tracking branch 'upstream/master'
rusik Aug 11, 2015
4f4dc93
Add handleDidBecomeActive method for cases when user starts authoriza…
rusik Aug 11, 2015
554a865
VKActivity slightly reworked
RomanTruba Aug 13, 2015
7014dc1
Fixed #262
RomanTruba Aug 24, 2015
1426acc
Fixed #253
RomanTruba Aug 24, 2015
b747adf
Changed gitignore
RomanTruba Aug 24, 2015
7c6ad3c
Preprared for carthage. Fixed #245
RomanTruba Aug 24, 2015
2b48548
Version up
RomanTruba Aug 24, 2015
c75420d
Merge branch 'master' of git://github.com/Sega-Zero/vk-ios-sdk
RomanTruba Aug 24, 2015
72ea282
Merge branch 'master' of git://github.com/Rusik/vk-ios-official-sdk
RomanTruba Aug 24, 2015
ac8ace8
Framework updated
RomanTruba Aug 24, 2015
708f734
Podspec issue fixed
RomanTruba Aug 25, 2015
6047877
Some appearance ignore for #249
RomanTruba Aug 25, 2015
9953a56
Updated for iOS 9
RomanTruba Sep 13, 2015
251447c
Changed readme and test application plist
RomanTruba Sep 13, 2015
48a4bfa
Fixed #269 #274 and others
RomanTruba Sep 14, 2015
b77d1ee
Version up
RomanTruba Sep 14, 2015
8f708cc
Update README.md
Oct 7, 2015
6093276
Implement authorization in SFSafariViewController
chipp Oct 8, 2015
4dcb08d
Rebuild to remove dsym warnings
RomanTruba Oct 7, 2015
3dd4dcd
Fixed #290
RomanTruba Oct 26, 2015
022b239
Merge branch 'master' of git://github.com/chipp/vk-ios-sdk
RomanTruba Oct 26, 2015
308189c
Special helper methods for parsing
RomanTruba Oct 29, 2015
f8e1b68
Improved error logging
RomanTruba Oct 29, 2015
1e5a851
Check if parsing object is dictionary
RomanTruba Oct 29, 2015
032ea3a
Fixed issue with headers in nsstring category
RomanTruba Oct 29, 2015
eb634e5
Improved VKAccessToken work
RomanTruba Oct 29, 2015
9c99880
Renamed parse permission function
RomanTruba Oct 29, 2015
381cee4
Authorization result helper class
RomanTruba Oct 29, 2015
9ab7c34
Improved library work. Rewrited authorization. Removed stupid http me…
RomanTruba Oct 29, 2015
64cdf28
Save access token in keychain
RomanTruba Oct 29, 2015
c03eb3a
Make wakeUpSession asyncronious
RomanTruba Oct 29, 2015
45cb26b
Fixed token renew if not required
RomanTruba Oct 29, 2015
6a583d5
Fixed ios framework scheme
RomanTruba Oct 29, 2015
4242606
Little refactoring
RomanTruba Oct 30, 2015
96b51ad
Fixed storyboard
RomanTruba Oct 30, 2015
86a786b
Project automatically formatted
RomanTruba Oct 30, 2015
f1fad4e
Added method for understanding if share extension avilable
RomanTruba Oct 30, 2015
2b8f62a
license updated
RomanTruba Oct 30, 2015
6510f75
Moved captcha error delegate call to UI delegate
RomanTruba Oct 30, 2015
c7d5b22
Documentation update
RomanTruba Oct 30, 2015
56c2080
Version updated
RomanTruba Oct 30, 2015
dbe5b16
Podspec version updated
RomanTruba Oct 30, 2015
a28f621
Framework updated
RomanTruba Oct 30, 2015
8fbee54
Missed framework files added
RomanTruba Oct 30, 2015
845d5fa
Copy localUser when copying token
RomanTruba Oct 30, 2015
0f54aaa
Moved to version 1.3.1
RomanTruba Oct 30, 2015
7fd17bf
Update README.md
Oct 30, 2015
bfcab6c
Update README.md
Oct 30, 2015
5b4108f
Update README.md
Oct 31, 2015
c70f0b8
Update README.md
Oct 31, 2015
5e9134c
Update README.md
Oct 31, 2015
086cc76
Added SafariServices framework as required framework for cocoapods
RomanTruba Nov 2, 2015
2e79921
Rebuild framework
RomanTruba Nov 2, 2015
5db3ad0
Removed dsym warnings by turning off Enable Modules
RomanTruba Nov 2, 2015
799fb92
Fixed #298
RomanTruba Nov 3, 2015
1d33556
Added safariservices framework to demo app
RomanTruba Nov 3, 2015
7124872
Changed vkSdkUserAuthorizationFailed method for #299
RomanTruba Nov 3, 2015
d5e0bfc
Added required frameworks for framework target
RomanTruba Nov 3, 2015
31c922c
Version set to 1.3.3
RomanTruba Nov 3, 2015
7968aa8
Fixed vk app logic
RomanTruba Nov 3, 2015
fd227bf
Changed way of processing app language
RomanTruba Nov 11, 2015
d8fcd04
Version set up to 1.3.5
RomanTruba Nov 11, 2015
910efb3
Fixed ukraine lang, and extra check for progress block added
RomanTruba Nov 11, 2015
2f90e32
Only add operation if not nil
PitNikola Sep 4, 2015
01279da
Providing cancel authorize controller error code
PitNikola Jul 6, 2015
fc50aa7
Version set to 1.3.6
RomanTruba Nov 11, 2015
db33504
Update README.md
Nov 12, 2015
aebd049
"notify" scope may cause bad user experience
RomanTruba Nov 17, 2015
4256963
Force bitcode for static library
RomanTruba Nov 17, 2015
9524b8f
Version set to 1.3.7
RomanTruba Nov 17, 2015
3dfcf35
Framework recompiled
RomanTruba Nov 17, 2015
5f6c11b
Refactored special permissions
RomanTruba Nov 26, 2015
3b94093
Removed framework target
RomanTruba Nov 30, 2015
7357629
Fixed #323
RomanTruba Nov 30, 2015
8e047de
Updated example
RomanTruba Nov 30, 2015
14d9ab7
Fixed #318
RomanTruba Nov 30, 2015
4a02e26
Updated project settings
RomanTruba Nov 30, 2015
30c7f75
Version set to 1.3.8. Additional cocoapods frameworks added
RomanTruba Nov 30, 2015
a90b876
Update README.md
Nov 30, 2015
a68502e
Added cancellation information to the UI delegate view controller dis…
Dec 24, 2015
2787238
Implemented VK Documents models and API methods
Jan 7, 2016
d947318
Updated gitignore
RomanTruba Jan 9, 2016
c41edc1
Fixed #345
RomanTruba Jan 9, 2016
43307ff
Version set to 1.3.9
RomanTruba Jan 9, 2016
57d8e70
Added missing VKAPIDocs methods
Jan 10, 2016
23f163a
minor fixes
Jan 11, 2016
3cc9cae
Added market permissions
RomanTruba Jan 11, 2016
cf66321
Version set to 1.3.10
RomanTruba Jan 11, 2016
910b4ea
Fixed #347
RomanTruba Jan 12, 2016
6663992
Version set to 1.3.11
RomanTruba Jan 12, 2016
81f1048
- Fix for default scope in VKShareDialogController. Looking for acces…
Jan 12, 2016
503bf73
- Formatting.
Jan 12, 2016
84441d4
Fixed #351
RomanTruba Jan 15, 2016
22041a1
Merge branch 'master' of git://github.com/driver733/vk-ios-sdk into d…
RomanTruba Jan 15, 2016
64e84de
Refactored poor method names. Added missing licences
RomanTruba Jan 15, 2016
0ee1451
Version set to 1.3.12
RomanTruba Jan 15, 2016
7e3def3
grammar fix? beautified md
Jan 24, 2016
4b9603e
Fixed #356
RomanTruba Jan 24, 2016
eae2886
Version set to 1.3.13
RomanTruba Jan 24, 2016
eef95cf
Fix the bug when attachments were not shown in VKShareDialogControlle…
HiDaN4 Feb 18, 2016
7960275
Merge pull request #367 from HiDaN4/master
Feb 18, 2016
d0bc4bc
Merge pull request #357 from npenzin/master
Feb 18, 2016
240e13b
Fixed possibility of garbage value being set.
andrijko13 Mar 1, 2016
d5e6f00
Fixed #371
RomanTruba Mar 15, 2016
871a049
Fixed #373
RomanTruba Mar 15, 2016
697edbd
Log error in share dialog, when not possible to load images
RomanTruba Mar 15, 2016
eeeff19
Merge branch 'master' of git://github.com/andriko13/vk-ios-sdk
RomanTruba Mar 15, 2016
408cb7e
Version set to 1.3.14
RomanTruba Mar 15, 2016
0927027
Fixed #353
RomanTruba Mar 15, 2016
30e4108
Version set to 1.3.15
RomanTruba Mar 15, 2016
74d2065
Fixed #328 #380
RomanTruba Mar 17, 2016
2a2d1e9
Version set to 1.3.16
RomanTruba Mar 17, 2016
9f9e229
Update README.md
kohver Mar 23, 2016
01a9871
Added search and edit methods for docs
goingreen Apr 2, 2016
aeb2d7c
Обновлены сигнатуры блоков
Apr 13, 2016
1f87380
Убрал сеттеры
Apr 13, 2016
397a4b2
Merge pull request #393 from ghost/master
May 12, 2016
8da93c0
Merge pull request #381 from kohver/master
May 12, 2016
072467f
Merge pull request #389 from goingreen/master
May 12, 2016
6c56787
Documentation improved
RomanTruba Mar 17, 2016
b5c31ac
initializeWithAppId docs updated. VKAccessToken private category updated
RomanTruba May 12, 2016
104299d
Fixed #397
RomanTruba May 12, 2016
197d90a
Version set to 1.3.17
RomanTruba May 12, 2016
4dd46e8
Update README.md
May 25, 2016
5dd3e82
Fixed #412
RomanTruba Jun 27, 2016
483b246
Lightweight generics for models
RomanTruba Jun 27, 2016
2a445ea
Fixed #410
RomanTruba Jun 27, 2016
906e8b6
Fixed #390
RomanTruba Jun 27, 2016
ecf361f
Add two basic test for loading and parsing
RomanTruba Jun 27, 2016
a63607e
Resources moved into asset catalog
RomanTruba Jun 27, 2016
dd39a64
Migrated to NSProcessInfo api for finding out the OS version of the c…
RomanTruba Jun 27, 2016
31b4193
Correct bundle for assets catalog images
RomanTruba Jun 27, 2016
9868336
Removed some deprecated methods for build target 9.0
RomanTruba Jun 27, 2016
ddbd457
Updated version and readme
RomanTruba Jun 27, 2016
98b76d0
Add travis.yml
RomanTruba Jun 27, 2016
32a5b4d
Project schemes added
RomanTruba Jun 27, 2016
1ae11da
Schemes configured for tests
RomanTruba Jun 27, 2016
db1865d
Allow any certificates for tests, to avoid test failed with SSL conne…
RomanTruba Jun 27, 2016
37ada22
Added required image and sdk for travis
RomanTruba Jun 27, 2016
e93fed4
Fixed resources for cocoapods
RomanTruba Jun 27, 2016
a1806eb
Update README.md
Jun 27, 2016
dfcb757
Fixed #424
RomanTruba Jul 18, 2016
2f8be07
Correct SDK version check
RomanTruba Jul 18, 2016
c056db5
Safe properties access
RomanTruba Jul 18, 2016
4ddf66e
Removed nsdata+md5, renamed nsstring+md5 category and method
RomanTruba Jul 18, 2016
c567b48
Version up to 1.4.3
RomanTruba Jul 18, 2016
22635ef
Update README.md
Akhrameev Jul 22, 2016
b7da2f2
Merge pull request #427 from Akhrameev/master
Jul 22, 2016
c754840
Fix potentially vulnerable code
Grebenschikov Jul 30, 2016
9cdb1c8
Rollback dev team ID
Grebenschikov Jul 30, 2016
d6d65a5
Fixed #432
RomanTruba Aug 2, 2016
c28582c
Version up to 1.4.4
RomanTruba Aug 2, 2016
5061d72
Merge pull request #431 from grebenschikov/master
Aug 2, 2016
963584a
Fixed #439
ItsTipTop Oct 4, 2016
e555a6f
Refactor
suzhaev Oct 4, 2016
d541e94
feat: added audio.get in test methods.
thePsguy Oct 8, 2016
ee2c21c
Merge pull request #450 from thePsguy/master
suzhaev Oct 21, 2016
1d472a0
Fix missing authentication callback on iOS 10 after user rejects syst…
HiveHicks Nov 2, 2016
a89eb3e
Version up to 1.4.5
suzhaev Nov 2, 2016
3ac4f0b
Fixed #458
suzhaev Nov 8, 2016
d1f94f4
Fixed #466
suzhaev Nov 29, 2016
a681011
Version up to 1.4.6
suzhaev Nov 29, 2016
ad40546
fix no newline warnings
teanet Jan 11, 2017
97530cc
Custom UINavigationController subclass for status bar styling instead…
fjsaorin Jan 19, 2017
06d6465
Merge pull request #484 from fjsaorin/custom
suzhaev Feb 1, 2017
deceee4
Fixed crash when unsubscribe in delegate method
CognitiveDisson Feb 2, 2017
79e37f4
Merge pull request #486 from avito-tech/master
suzhaev Feb 3, 2017
7c4cc6e
Add cancel button on ‘error while posting’ alert
May 5, 2017
80d79e4
Merge pull request #482 from teanet/feature/#-fix-no-newlines
suzhaev May 22, 2017
a803a4e
Merge pull request #497 from atom-wintermute/feature/error-while-post…
suzhaev Jul 18, 2017
f3a6ca1
Fix retain cycle between VKRequest and VKError
Aug 10, 2017
5504d80
Merge pull request #513 from constZinovyev/fix-vkrequest-retain-cycle
suzhaev Nov 30, 2017
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 34 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
#OS noise
profile
[Tt]humbs.db
*.DS_Store
*~
*.swp
*.out
*.bak*
*.lock

#Other CSM
.hg
.svn
CVS

#Xcode noise
*.log
*~.nib
*.moved-aside
**/*.xcuserdata/*
xcuserdata

#Project files
[Bb]uild/
DerivedData/

#CocoaPods
Pods

#AppCode
*/.idea/*
.idea/*

SDKBuildSteps.info
5 changes: 5 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
language: objective-c
osx_image: xcode7.3
xcode_project: VK-ios-sdk.xcodeproj
xcode_scheme: VKSdk
xcode_sdk: iphonesimulator9.3
2 changes: 1 addition & 1 deletion LICENSE
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2013 VK.com
Copyright (c) 2015 VK.com

Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
Expand Down
345 changes: 344 additions & 1 deletion README.md
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,4 +1,347 @@
vk-ios-sdk
==========

Library for working with VK API, authorization through VK app, using VK functions
Library for working with VK API, authorizing through VK app, using VK API methods. Supported iOS from 6.0
Prepare for Using VK SDK
----------

To use VK SDK primarily you need to create a new Standalone VK application [here](https://vk.com/editapp?act=create). Choose a title and confirm the action via SMS and you will be redirected to the application settings page.
You will need your APP_ID to use the library. Fill in the App Bundle for iOS field.

Setup URL schema of Your Application
----------

To authorize via VK App you need to setup a url-schema for your application, which looks like vk+APP_ID (e.g. **vk1234567**).

[How to implement your own URL Scheme here](https://developer.apple.com/library/ios/documentation/iPhone/Conceptual/iPhoneOSProgrammingGuide/Inter-AppCommunication/Inter-AppCommunication.html#//apple_ref/doc/uid/TP40007072-CH6-SW10), Also there is [nice Twitter tutorial](https://dev.twitter.com/cards/mobile/url-schemes)


Configuring application for iOS 9
----------
iOS 9 changes the way of applications security and way of using unsecured connections. Basically, you don't have to change anything in transport security settings. But, if you're planing to use VK API with `nohttps` scope, you have to change security settings that way (in your `Info.plist` file):
```
<key>NSAppTransportSecurity</key>
<dict>
<key>NSExceptionDomains</key>
<dict>
<key>vk.com</key>
<dict>
<key>NSExceptionRequiresForwardSecrecy</key>
<false/>
<key>NSIncludesSubdomains</key>
<true/>
<key>NSExceptionAllowsInsecureHTTPLoads</key>
<true/>
</dict>
</dict>
</dict>
```

We **don't** recommend using `nohttps` scope.

Also, for iOS 9 you have to add app schemas your app will use and check for `canOpenURL:`.

Add this to your `Info.plist`:
```
<key>LSApplicationQueriesSchemes</key>
<array>
<string>vk</string>
<string>vk-share</string>
<string>vkauthorize</string>
</array>
```

How to set up VK iOS SDK
==========

Installation with CocoaPods
----------

CocoaPods is a dependency manager for Objective-C, which automates and simplifies the process of using 3rd-party libraries like VK SDK in your projects. See the [Getting Started](http://cocoapods.org/) guide for more information.

`Podfile`

platform :ios, '6.0'
target 'YourProjectName' do
pod 'VK-ios-sdk'
end

Then import the project as module if your podfile contains `use_frameworks!` directive:

@import VK_ios_sdk;

Or import the main project header, if you're installing pods without `use_frameworks!` directive:

#import <VK-ios-sdk/VKSdk.h>

Installation with [Carthage](https://github.com/Carthage/Carthage)
----------
*iOS 8 and upper only*

Add this to you `Cartfile`:
```
github "VKCOM/vk-ios-sdk" >= 1.4
```

See building instructions for [Carthage here](https://github.com/Carthage/Carthage#if-youre-building-for-ios)

Then import the main header.

#import <VKSdkFramework/VKSdkFramework.h>

Installation with framework project
----------

If you're targeting iOS 8 and upper, you can use the SDK framework target. Add `VK-ios-sdk.xcodeproj` as sub-project to your project. Open your project in Xcode **->** Go to **General** tab **->** Find the **Embedded Binaries** section **->** Click **Add items** (plus sign) **->** And select `VKSdkFramework.framework` from the VK-ios-sdk project lastly import the main header:

#import <VKSdkFramework/VKSdkFramework.h>


Using SDK
==========

SDK Initialization
----------
1) Put this code to the application delegate method

```
//iOS 9 workflow
- (BOOL)application:(UIApplication *)app openURL:(NSURL *)url options:(NSDictionary<NSString *,id> *)options {
[VKSdk processOpenURL:url fromApplication:options[UIApplicationOpenURLOptionsSourceApplicationKey]];
return YES;
}

//iOS 8 and lower
-(BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation
{
[VKSdk processOpenURL:url fromApplication:sourceApplication];
return YES;
}
```
Note: if you already have FaceBook SDK added and one of this methods returns `[FBSDKDelegate ...]` you can handle it
```
-(BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation {

[[FBSDKApplicationDelegate sharedInstance] application:application openURL:url sourceApplication:sourceApplication annotation:annotation];
[VKSdk processOpenURL:url fromApplication:sourceApplication];
return YES;
}
```
2) Initialize VK SDK with your APP_ID for any delegate

```
VKSdk *sdkInstance = [VKSdk initializeWithAppId:YOUR_APP_ID];
```

Starting from version 1.3 there are two types of delegates available: common delegate and UI delegate. You can register as much common delegates, as you need, but an UI delegate may be only one. After the SDK initialization you should register delegates separately:
```
[sdkInstance registerDelegate:delegate];
[sdkInstance setUiDelegate:uiDelegate];
```
or
```
[[VKSdk initializeWithAppId:APP_ID] registerDelegate:delegate];
```
You will find full description of `VKSdkDelegate` and `VKSdkUIDelegate` protocols [here](http://cocoadocs.org/docsets/VK-ios-sdk) or [here](http://vkcom.github.io/vk-ios-sdk/index.html)


3) You need to check, if there is previous session available, so call asynchronous method `wakeUpSession:completeBlock:`

```
NSArray *SCOPE = @[@"friends", @"email"];

[VKSdk wakeUpSession:SCOPE completeBlock:^(VKAuthorizationState state, NSError *error) {
if (state == VKAuthorizationAuthorized) {
// Authorized and ready to go
} else if (error) {
// Some error happend, but you may try later
}
}];
```
You will find full list of available SCOPE permission [here](https://vk.com/dev/permissions)

Check out the VKAuthorizationState parameter. You can get several states:
* VKAuthorizationInitialized – means the SDK is ready to work, and you can authorize user with `+authorize:` method. Probably, an old session has expired, and we wiped it out. *This is not an error.*
* VKAuthorizationAuthorized - means a previous session is okay, and you can continue working with user data.
* VKAuthorizationError - means some error happened when we tried to check the authorization. Probably, the internet connection has a bad quality. You have to try again later.
```
[VKSdk wakeUpSession:SCOPE completeBlock:^(VKAuthorizationState state, NSError *err) {
if (state == VKAuthorizationAuthorized) {
// authorized
} else {
// auth needed
}
}];
```

User Authorization
----------

If you don't have a session yet, you have to authorize user with a next method:
```
[VKSdk authorize:scope];
```
You have to conform to both `VKSdkDelegate` and `VKSdkUIDelegate` protocols to get appropriate methods called.

After the authorization, all common delegates will be called with a next method:
```
- (void)vkSdkAccessAuthorizationFinishedWithResult:(VKAuthorizationResult *)result;
```

`VKAuthorizationResult` contains some initial information: new access token object, basic user information, and error (if authorization failed).
[Complete documentation here](http://vkcom.github.io/vk-ios-sdk/index.html)

API Requests
==========

VK API Request syntax
----------
Below we have listed some examples for several request types.

1) Plain request
```
VKRequest *usersReq = [[VKApi users] get];
```

2) Request with parameters
```
VKRequest *audioReq = [[VKApi audio] get:@{VK_API_OWNER_ID : @"896232"}];
```

3) Request with predetermined maximum number of attempts
```
VKRequest *postReq = [[VKApi wall] post:@{VK_API_MESSAGE : @"Test"}];
postReq.attempts = 10;
//or infinite
//postReq.attempts = 0;
```
It will take 10 attempts until succeeds or an API error occurs

4) Request that calls any method of VK API
```
VKRequest *getWall = [VKRequest requestWithMethod:@"wall.get" andParameters:@{VK_API_OWNER_ID : @"-1"}];
```

5) Request that uploads a photo to a user's wall
```
VKRequest *request = [VKApi uploadWallPhotoRequest:[UIImage imageNamed:@"my_photo"] parameters:[VKImageParameters pngImage] userId:0 groupId:0 ];
```

Request firing
----------
```
[audioReq executeWithResultBlock:^(VKResponse *response) {
NSLog(@"Json result: %@", response.json);
} errorBlock:^(NSError * error) {
if (error.code != VK_API_ERROR) {
[error.vkError.request repeat];
} else {
NSLog(@"VK error: %@", error);
}
}];
```

Error Handling
----------
Every request can return `NSError` with domain equal to `VKSdkErrorDomain`. SDK can return networking error or internal SDK error (e.g. request was canceled). Category `NSError+VKError` provides `vkError` property that describes error event. Compare error code with the global constant `VK_API_ERROR`. If they are equal that means you process `vkError` property as API error. Otherwise you should handle an http error.

SDK can handle some errors (e.g., captcha error, validation error). Appropriate ui delegate method will be called for this purpose.
Below is an example of captcha error processing:
```
- (void)vkSdkNeedCaptchaEnter:(VKError *)captchaError
{
VKCaptchaViewController *vc = [VKCaptchaViewController captchaControllerWithError:captchaError];
[vc presentIn:self];
}
```

Batch Processing Requests
----------
SDK allows to execute several unrelated requests at the one call (aka Batch Request).

1) Prepare requests
```
VKRequest *request1 = [[VKApi audio] get];
request1.completeBlock = ^(VKResponse *) { ... };

VKRequest *request2 = [[VKApi users] get:@{VK_USER_IDS : @[@(1), @(6492), @(1708231)]}];
request2.completeBlock = ^(VKResponse *) { ... };
```
2) Merge requests into one
```
VKBatchRequest *batch = [[VKBatchRequest alloc] initWithRequests:request1, request2, nil];
```
3) Fire the obtained request
```
[batch executeWithResultBlock:^(NSArray *responses) {
NSLog(@"Responses: %@", responses);
} errorBlock:^(NSError \*error) {
NSLog(@"Error: %@", error);
}];
```
4) The result of each method returns to a corresponding completeBlock. Response array contains result of the requests in order they have been passed.


Working with Share dialog
==========
Share dialog allows you to create a user friendly dialog for sharing text and photos from your application directly to VK. See the Share dialog usage example:
```
VKShareDialogController *shareDialog = [VKShareDialogController new]; //1
shareDialog.text = @"This post created using #vksdk #ios"; //2
shareDialog.vkImages = @[@"-10889156_348122347",@"7840938_319411365",@"-60479154_333497085"]; //3
shareDialog.shareLink = [[VKShareLink alloc] initWithTitle:@"Super puper link, but nobody knows" link:[NSURL URLWithString:@"https://vk.com/dev/ios_sdk"]]; //4
[shareDialog setCompletionHandler:^(VKShareDialogControllerResult result) {
[self dismissViewControllerAnimated:YES completion:nil];
}]; //5
[self presentViewController:shareDialog animated:YES completion:nil]; //6
```
1) Create an instance of the dialog controller as usual

2) Attach some text information to a dialog. Notice that users can change this information

3) Attach images uploaded to VK earlier. If you want user to upload a new image use `uploadImages` property

4) Attach link at your pages

5) Set the dialog completion handler

6) Present the dialog view controller to your view controller


Working with share activity
==========

VK SDK provides a special class to work with `UIActivityViewController` - `VKActivity`.

Pay attention to the fact, that a VK App has it own Share extension since version 2.4. Since version 2.5 it will support special URL scheme to check if Share extension is available. You should call `[VKActivity vkShareExtensionEnabled]` method to remove `VKActivity` from activities list, if a VK share extension is available.

Check the example below to understand how it works:

```
NSArray *items = @[[UIImage imageNamed:@"apple"], @"Check out information about VK SDK" , [NSURL URLWithString:@"https://vk.com/dev/ios_sdk"]]; //1
UIActivityViewController *activityViewController = [[UIActivityViewController alloc]
initWithActivityItems:items
applicationActivities:@[[VKActivity new]]]; //2
[activityViewController setValue:@"VK SDK" forKey:@"subject"]; //3
[activityViewController setCompletionHandler:nil]; //4
if (VK_SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(@"8.0")) {
UIPopoverPresentationController *popover = activityViewController.popoverPresentationController;
popover.sourceView = self.view;
popover.sourceRect = [tableView rectForRowAtIndexPath:indexPath];
} //5
[self presentViewController:activityViewController animated:YES completion:nil]; //6
```

Let's go through the example step-by-step

1) Prepare your share information - `UIImage`, `NSString` and `NSURL`. That kind of information may be shared through VK

2) Prepare `UIActivityViewController` with a new application `VKActivity`

3) Set additional properties for `activityViewController`

4) Set completion handler for `activityViewController`

5) Check if you're running iOS 8 or upper. If user is using iPad, you have to present the activity controller in a popover otherwise you'll get system error

6) Present the activity controller as usual
Loading