0.0.1-alpha.34 • Published 5 years ago

fk-games-sdk v0.0.1-alpha.34

Weekly downloads
-
License
Apache-2.0
Repository
-
Last release
5 years ago

Flipkart Games SDK

Installation

  • Install fk-games-sdk into your npm project. You can use the following command and run it in your terminal at the project root.
npm install fk-games-sdk
  • You could also use fk-games-sdk by directly including the script into your html file.
http://img1a.flixcart.com/linchpin-web/batman-returns/build/fk-game-sdk@0.0.1-alpha.27.js
  • Minified and GZipped script
http://img1a.flixcart.com/linchpin-web/batman-returns/build/fk-game-sdk-min@0.0.1-alpha.27.js

You could replace version numbers in the script tag with the latest npm version if the README isn't up to date.

Initialize using NPM

// NPM only : import will make sure we create FKExtension on the window object to give clients a way to create new platform instance and access modules
import * as GamesSDK from  "fk-games-sdk";
// NOTE - please refrain from calling any module before the DOMContentLoaded callback
window.addEventListener('DOMContentLoaded', function() {
    const fkPlatform = FKExtension.newPlatformInstance();
    fkPlatform.getModuleHelper().getAnalyticsModule().sendGameAnalyticsEvent({
            gameName: 'bestGame'
            campaignId?: 'abc-zyx';
            energyPoints?: 300;
            league?: 'gold';
            badgesCount?: 2;
            friendCount?: 150;
            position?: 4;
            transactions?: ['power', 'time'];
            rewards?: ['first', 'second'];
            powers?: ['strength'];
            deathCount?: 3;
            livesLeft?: 2;
            actionType: GameActionType.SHARE;
        }
    ).then((data) => {
        // Do something based on data
    });
});

Usage

fk-games-sdk is a set of modules that help client use Flipkart functionalities for easy game development. All modules are promisified.

goBack()
navigate(action)
sendGameAnalyticsEvent(gameEventData)
getCurrentTime()
  • ShareModule - fkPlatform.getModuleHelper().getShareModule()
share(url, title)
resolveImage(url, width, height, quality)
  • AssetsModule - fkPlatform.getModuleHelper().getAssetsModule()
getAssetMap(themeId)
setStatusBarColor(color)
disableFlyout()
enableFlyout()
0.0.1-alpha.34

5 years ago

0.0.1-alpha.32

5 years ago

0.0.1-alpha.31

5 years ago

0.0.1-alpha.30

5 years ago

0.0.1-alpha.29

5 years ago

0.0.1-alpha.20

5 years ago

0.0.1-alpha.19

5 years ago

0.0.1-alpha.18

5 years ago

0.0.1-alpha.17

5 years ago

0.0.1-alpha.16

5 years ago

0.0.1-alpha.15

5 years ago

0.0.1-alpha.14

5 years ago

0.0.1-alpha.13

5 years ago

0.0.1-alpha.12

5 years ago

0.0.1-alpha.11

5 years ago

0.0.1-alpha.10

5 years ago

0.0.1-alpha.9

5 years ago

0.0.1-alpha.8

5 years ago

0.0.1-alpha.7

5 years ago

0.0.1-alpha.6

5 years ago

0.0.1-alpha.5

5 years ago

0.0.1-alpha.4

5 years ago

0.0.1-alpha.3

5 years ago

0.0.1-alpha.2

5 years ago

0.0.1-alpha.1

5 years ago