Join our chat on the app: Telegram Messenger, https://t.me/OkAnfroidSdk
Android SDK and sample for native apps integrated with OK.RU
You can add next maven dependency in your project:
ru.ok:odnoklassniki-android-sdk:[MAVEN_CENTRAL_VERSION]
For example, your gradle script will contains such dependencies:
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'ru.ok:odnoklassniki-android-sdk:2.1.8'
}
An application registered within OK platform should have:
- Target platform checked (like ANDROID or IOS). You can act without ANDROID platform being activated, however since the SDK by default is passing platform=android to all REST calls, it's recommended to specify OkRequestMode.NO_PLATFORM_REPORTING when doing your requests
- EXTERNAL platform checked
- Client OAUTH checkbox checked
- A VALUABLE_ACCESS permission being checked or requested
- (highly recommended) LONG_ACCESS_TOKEN permission requested from api-support in order to be able to use tokens with long ttl
- AndroidManifest.xml:
- OkAuthActivity should be added (see Quick Start example)
- If using sdk.getInstallSource
- a dependency to play-services-ads to get advertising id
A quick-start with login and viral widgets is available in example