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
ANDROIDplatform being activated, however since the SDK by default is passingplatform=androidto all REST calls, it's recommended to specifyOkRequestMode.NO_PLATFORM_REPORTINGwhen doing your requests
- NOTE: You can act without
EXTERNALplatform checkedClient OAUTHcheckbox checked- A
VALUABLE_ACCESSpermission being checked or requested - (highly recommended)
LONG_ACCESS_TOKENpermission 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