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 modulesimport * as GamesSDK from "fk-games-sdk";// NOTE - please refrain from calling any module before the DOMContentLoaded callbackwindow.addEventListener;
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()