Android SDK and sample for native apps integrated with OK.RU
NOTE: If maven release is outdated and you need recent changes then you need to clone the project and depend on it locally.
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).
- NOTE: You can act without
ANDROID
platform being activated, however since the SDK by default is passingplatform=android
to all REST calls, it's recommended to specifyOkRequestMode.NO_PLATFORM_REPORTING
when doing your requests
- NOTE: You can act without
EXTERNAL
platform checkedClient 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
- 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