iOS library for working with Odnoklassniki API
Clone or download
Latest commit 68b1b52 Dec 20, 2016
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.gitignore Initial commit Sep 8, 2014
LICENSE Initial commit Sep 8, 2014
OKSDK.h currentAccessTokenSecretKey public method Jun 2, 2016
OKSDK.m Update OKSDK.m Dec 20, 2016
README.md Update README.md Dec 20, 2016
ok-ios-sdk.podspec Update ok-ios-sdk.podspec Dec 20, 2016

README.md

Join our chat on the app: Telegram Messenger, https://telegram.me/joinchat/An0xvgHDHvWlSWNQWuzOkQ

###OK IOS SDK 2.0.14

Join the chat at https://gitter.im/apiok/ok-ios-sdk

If you are looking for the old version, please checkout tag 1.0 ####How to use First you should select External and IOS platforms and enable Client OAuth authorization using ok.ru app edit form. Also your should send request for LONG_ACCESS_TOKEN to api-support or you can simple not request for LONG_ACCESS_TOKEN permission during OAuth authorization.

Add ok{appId} schema to your app Info.plist file. For example ok12345 if your app has appId 12345. Don't forget add ok{appId}://authorize to allowed redirect urls for your application in ok.ru app profile. Also you should add next block to your Info.plist file.

 <key>NSAppTransportSecurity</key>
    <dict>
        <key>NSAllowsArbitraryLoads</key>
        <true/>
    </dict>

Add OKSDK.h and OKSDK.m to your project. For example you can use git submodule.

Init your sdk in AppDelegate didFinishLaunchingWithOptions

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
    OKSDKInitSettings *settings = [OKSDKInitSettings new];
    settings.appKey = @"ABCDEFGABCDEGF";
    settings.appId = @"12345";
    settings.controllerHandler = ^{
        return self.window.rootViewController;
    };
    [OKSDK initWithSettings: settings];
    return YES;
}

Add openUrl to AppDelegate openURL

-(BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation {
    [OKSDK openUrl:url];
    return YES;
}

To understand how to interact with OKSDK please look at examples repository