
Security News
Open Source Maintainers Feeling the Weight of the EU’s Cyber Resilience Act
The EU Cyber Resilience Act is prompting compliance requests that open source maintainers may not be obligated or equipped to handle.
@inappstory/game-center-api
Advanced tools
API for integration with GameReader (WebView) inside native apps
API for integration with GameReader (WebView) inside native apps
import { createSdkApi } from "@inappstory/game-center-api";
const mounted = () => {
// ready to render UI
const rootElement = document.getElementById("root");
const root = createRoot(rootElement!);
root.render(<App />);
};
createSdkApi({
mounted,
beforeUnmount: () => {
/* Stop AudioContext for instance */
},
onPause: () => {
/* Call on focus lost. Stop game timers for instance */
},
onResume: () => {
/* Call on focus return. Resume game timers for instance */
},
onBackGesture: () => {
/* Call on Android back gesture */
},
gameShouldForeground: () => {
/* splash animation finished, now we can start bg music and etc */
},
});
const gameLoaded = () => {
GameCenterApi.gameLoadedSdkCallback();
};
const gameStarted = () => {
setTimeout(() => {
// Wait for render complete - then remove native loader screen
GameCenterApi.gameShouldForegroundCallback();
}, 50);
};
const gameShouldForeground = () => {
// splash animation finished, now we can start bg music and etc
gameStarted();
};
// calling gameLoadedSdkCallback removes the loading screen
import { gameLoadedSdkCallback } from "@inappstory/game-center-api";
const rootElement = document.getElementById("root");
const root = createRoot(rootElement!);
root.render(<AppWithCallbackAfterRender cb={gameLoaded} />);
import GameCenterApi from "@inappstory/game-center-api";
// call only after mounted event (from GameCenterApi.createSdkApi
const getUserId = () => GameCenterApi.gameLaunchConfig.clientConfig.userId;
import GameCenterApi, { type PlaceholderType, Placeholder } from "@inappstory/game-center-api";
// call only after mounted event (from GameCenterApi.createSdkApi
const getPlaceholder = (name: string, type: PlaceholderType): Placeholder | undefined => {
return GameCenterApi.gameLaunchConfig.clientConfig.placeholders.find(placeholder => placeholder.name === name && placeholder.type === type);
};
const avatarUrl = getPlaceholder("avatar", PlaceholderType.IMAGE);
import GameCenterApi from "@inappstory/game-center-api";
// closeGameReader - close or not GameReader
const openUrl = (url: string) => GameCenterApi.openUrl({ url, closeGameReader: true });
import GameCenterApi from "@inappstory/game-center-api";
const closeGame = () => GameCenterApi.closeGameReader();
import GameCenterApi from "@inappstory/game-center-api";
// 1.2.3
const version: string | null = GameCenterApi.getApplicationVersion();
import GameCenterApi from "@inappstory/game-center-api";
// 300
const version: number | null = GameCenterApi.getApplicationBuildVersion();
FAQs
API for integration with GameReader (WebView) inside native apps
The npm package @inappstory/game-center-api receives a total of 12 weekly downloads. As such, @inappstory/game-center-api popularity was classified as not popular.
We found that @inappstory/game-center-api demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
The EU Cyber Resilience Act is prompting compliance requests that open source maintainers may not be obligated or equipped to handle.
Security News
Crates.io adds Trusted Publishing support, enabling secure GitHub Actions-based crate releases without long-lived API tokens.
Research
/Security News
Undocumented protestware found in 28 npm packages disrupts UI for Russian-language users visiting Russian and Belarusian domains.