OK Games Platform allows you to develop HTML5 games and applications which can be played by users on any mobile platform available: mobile web, OK Android application an OK IOS application.
Setting up your application
To enable launching your game on all mobile platforms first of all you need to correctly set it up. For this you need to create new or edit existing app and enable HTML (Mobile) platform for it.
If it happens that you still do not have an application here is a manual that describes how to create an app.
For newly created app or for an existing one you can enable platform like this:
You can also fix layout on android platform in app settings:
Integration with OK
After you’ve correctly configured your application it should be available by a direct link https://m.ok.ru/game/gameId.
Application ID can be acquired from multiple places, i.e. from an email that was sent to you after you’ve create an app. It also has app’s secret and public keys which are used to work with our API.
When app is launched on our platform a list of additional parameters will be passed for you to identify a user who launched your app, his session data and other useful information.
Full list can be found by this link.
If a game was launched on mobile platform additional parameter mob=true will be present.
Setting up SDK
To integrate your game with OK you should use multiplatform JS SDK.
API and SDK features
SDK allows you to do the following:
- create new post in user’s feed via publishing widget;
- invite or suggest a game to other users via game invite widget;
- invoke REST API methods.
We have some example applications which implement described features:
Payments and monetization
Instant Games can be monetized using this two options:
We also have example apps that implement this features:
For payments to work correct callback url must be specified in your app’s settings
Testing your app
At any time you can test your application.
By default it is available only to it’s creator. To make it available for other users you should follow this two steps:
- user to whom you want to provide an access to your app must get developer’s access;
- app’s creator must add this user to app developers list.
After this your app must be available to this user via direct link https://m.ok.ru/game/gameId. You can access your app on mobile web (m.ok.ru), OK android app or OK IOS app.
In addition to this in our Android App you can launch your game from “My games” section. A couple of conditions must be met for your app to appear in this list:
- you need to be app’s developer;
- MOBILE_HTML platform must be set in app’s settings;
- you need to launch at least one game on any mobile platform for section to appear.
On either Android or iOS platforms you have an ability to debug your application via system’s browser remote debugging tool.
Debugging on iOS
Two most common ways to launch your app on this platform are:
- using Safari browser from OK’s mobile version - m.ok.ru;
- using Safari from OK’s native iOS application.
For both cases you can use Safari’s remote inspector tool to debug your app.
Manual for enabling this tool can be found via this link - safari remote inspector
Debugging on Android
Two most common ways to launch your app on Android are:
- using Chrome browser from OK’s mobile version - m.ok.ru;
- using Android Webview from OK’s native app for Android platform.
Chrome remote debugging tool can be used to debug your app in this case. Manual to enable this feature can be found here - android remote debugging
If you are trying to debug your app launched from Android Webview make sure that:
- Android OS version on your device is 4.4 or higher;
- you’ve requested us to enable debug feature for your app via firstname.lastname@example.org.
If your app is ready to be published it must be moderation by our games moderation team. To send it for moderation you should use special form
Select HTML mobile app as platform and proceed your request. If everything went fine you will get an email with credentials to our Jira for game developers.
If you have any questions linked with API or OK games platform that are not covered here please send your questions to email@example.com
Can i use same OK app for different platforms (Web, mobile, etc.)
Yes. Actually, this is a recommended way to develop a mobile app. In this case your web and mobile versions of a game will share user base, notifications and other good things.
Is there an option to use a different URLs for web and mobile platforms
Yes. If you need to specify different URLs for different platforms please send a request to firstname.lastname@example.org via email.
Is there an option to set preferred display orientation for your app
Yes. You can’t set it in app’s settings but you can request us to set landscape orientation as default via email@example.com