Code Monkey home page Code Monkey logo

kukushka_unitysdk's Introduction

About Kukushka SDK

Kukushka SDK makes it easy to give players survey tasks followed by a reward. The SDK can be installed and set up in minutes.

This version is designed for the Unity game engine. Other versions of the SDK can be found below:

  • Android SDK coming soon!
  • iOS SDK coming soon!

Requirements

This SDK requires Unity 2018.4+ and provided only for Android and iOS games.

  • Android 5+ supported;
  • iOS 7+ supported;

Get Started

Automatic installation and Setup steps:

  1. Download latest version of SDK from Releases page or directly from this repository;
  2. Add .unitypackage file to your project;
  3. Open setup wizard using "Kykyshka SDK" => "Setup Wizard" window;
  4. Type your App Key in the Setup Wizard;
  5. Open Example scene and build your Android or iOS application;
  6. Enjoy!

Manual SDK setup in your project:
Create your game script and initialize SDK by creating object:

Kykyshka sdkInstance = new Kykyshka(new SDKOptions
{
    DebugMode = true,               // Debug Mode โ€” when active will always display a demo survey regardless of AppKey, UserID, your geo etc. Useful for testing
    AppKey = "gamedemo",            // Application Key
    UserID = "demouserid"           // User ID
});

Pro tip: test your integrations with DebugMode = true to immediately see how the game would behave with an active survey

Also you can set custom UserID for your game by SetUserID method:

sdkInstance.SetUserID(your_game_user_id);

SDK Usage:
Now you can call two main methods of Kykyshka SDK to preload and show Survey for user:

sdkInstance.HasSurvey();    // To Check and Preload Available Survey for this user
sdkInstance.ShowSurvey();   // To Show Survey for user

SDK Callbacks:
Kukushka SDK has a lot of different Callbacks for your game. Use this callbacks to detect Survey Complete or problems with loading.

Callback Parameters Usage
OnSurveyStart - Called when user started survey
OnSurveyAvailable - Called after preloading if surveys available
OnSurveyUnavailable - Called after preloading if surveys unavailable
OnSuccess int or null Called when user complete survey. May contain additional data.
OnFail SurveyResult or null Called when user got error in the survey. May contain additional data.
OnLoadFail - Called when Survey has loading error
OnError - On General SDK Errors Callback

Callbacks Example:

// Add Survey Callbacks
sdkInstance.OnSurveyStart = () =>
{
    // Called when user started survey
};
sdkInstance.OnSuccess = hq =>
{
    // Called when user complete survey
};
sdkInstance.OnFail = data =>
{
    // Called when user got error in the survey
};
sdkInstance.OnLoadFail = () =>
{
    // Called when Survey has loading error 
};
            
// Add Preloading Callbacks
sdkInstance.OnSurveyAvailable = () =>
{
    // Called after preloading if surveys available
};
sdkInstance.OnSurveyUnavailable = () =>
{
    // Called after preloading if surveys unavailable
};

Screen Orientation

Please, note: Currently version of Kukushka SDK supports only Portrait orientation and your game orientation will be force changed to Portrait at Survey opening and returned to last orientation after Survey closed.

Third-Party Modules

Kukushka SDK uses WebView module to show Survey Window for your users.

This module provided by Third-Party Open-Source Library and can be found here:
https://github.com/gree/unity-webview

kukushka_unitysdk's People

Contributors

filippgit avatar hitmen047 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.