0.0.1-alpha.34 • Published 7 years ago
fk-games-sdk v0.0.1-alpha.34
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.jsYou 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.
- NavigationModule - fkPlatform.getModuleHelper().getNavigationModule()
goBack()
navigate(action)- AnalyticsModule - fkPlatform.getModuleHelper().getAnalyticsModule()
sendGameAnalyticsEvent(gameEventData)- ServerTimeModule - fkPlatform.getModuleHelper().getServerTimeModule()
getCurrentTime()- ShareModule - fkPlatform.getModuleHelper().getShareModule()
share(url, title)- ImageResolverModule - fkPlatform.getModuleHelper().getImageResolverModule()
resolveImage(url, width, height, quality)- AssetsModule - fkPlatform.getModuleHelper().getAssetsModule()
getAssetMap(themeId)- GenericUtilsModule - fkPlatform.getModuleHelper().getGenericUtilsModule()
setStatusBarColor(color)
disableFlyout()
enableFlyout()0.0.1-alpha.34
7 years ago
0.0.1-alpha.32
7 years ago
0.0.1-alpha.31
7 years ago
0.0.1-alpha.30
7 years ago
0.0.1-alpha.29
7 years ago
0.0.1-alpha.20
7 years ago
0.0.1-alpha.19
7 years ago
0.0.1-alpha.18
7 years ago
0.0.1-alpha.17
7 years ago
0.0.1-alpha.16
7 years ago
0.0.1-alpha.15
7 years ago
0.0.1-alpha.14
7 years ago
0.0.1-alpha.13
7 years ago
0.0.1-alpha.12
7 years ago
0.0.1-alpha.11
7 years ago
0.0.1-alpha.10
7 years ago
0.0.1-alpha.9
7 years ago
0.0.1-alpha.8
7 years ago
0.0.1-alpha.7
7 years ago
0.0.1-alpha.6
7 years ago
0.0.1-alpha.5
7 years ago
0.0.1-alpha.4
7 years ago
0.0.1-alpha.3
7 years ago
0.0.1-alpha.2
7 years ago
0.0.1-alpha.1
7 years ago