@inappstory/game-center-api 1.3.10 → 1.3.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -41,6 +41,9 @@ export type GameLaunchConfig = {
41
41
  };
42
42
  screenOrientation: ScreenOrientation;
43
43
  sdkVersion: string;
44
+ sdkFeatures?: {
45
+ gameShouldForegroundCallback?: boolean;
46
+ };
44
47
  sessionId: string;
45
48
  userAgent: string;
46
49
  userId: string;
package/lib/index.d.ts CHANGED
@@ -50,7 +50,7 @@ declare const GameCenterApi: {
50
50
  getSemverSdkVersion: () => false | import("semver").SemVer | null;
51
51
  gameLocalData: import("./localData").LocalDataMap<string, any>;
52
52
  sendIasApiRequest: typeof sendIasApiRequest;
53
- openUrl: ({ url, closeGameReader }: import("./sdkApi/openUrl.h").OpenUrlOptions) => void;
53
+ openUrl: ({ url, closeGameReader, closeGameReaderPayload }: import("./sdkApi/openUrl.h").OpenUrlOptions) => void;
54
54
  shareText: (text: string) => Promise<boolean>;
55
55
  shareUrl: (url: string) => Promise<boolean>;
56
56
  shareFiles: (files: {
@@ -333,11 +333,16 @@ const isSdkSupportGameShouldForegroundCallback = () => {
333
333
  let support = false;
334
334
  const semverVersion = (0, env_1.getSemverSdkVersion)();
335
335
  if (semverVersion != null && semverVersion) {
336
+ // for js-sdk
336
337
  // gte(v1, v2): v1 >= v2
337
338
  if (semver.gte(semverVersion, "2.12.0-rc.11")) {
338
339
  support = true;
339
340
  }
340
341
  }
342
+ // for react-sdk
343
+ if (gameLaunchConfig_1.gameLaunchConfig.clientConfig?.sdkFeatures?.gameShouldForegroundCallback === true) {
344
+ support = true;
345
+ }
341
346
  return support;
342
347
  }
343
348
  };
@@ -1,2 +1,2 @@
1
1
  import { OpenUrlOptions } from "./openUrl.h";
2
- export declare const openUrl: ({ url, closeGameReader }: OpenUrlOptions) => void;
2
+ export declare const openUrl: ({ url, closeGameReader, closeGameReaderPayload }: OpenUrlOptions) => void;
@@ -1,4 +1,6 @@
1
+ import { type CloseGameReaderOptions } from ".";
1
2
  export type OpenUrlOptions = {
2
3
  url: string;
3
4
  closeGameReader?: boolean;
5
+ closeGameReaderPayload?: CloseGameReaderOptions;
4
6
  };
@@ -4,7 +4,7 @@ exports.openUrl = void 0;
4
4
  const env_1 = require("../env");
5
5
  const Source_1 = require("./web/Source");
6
6
  const index_1 = require("./index");
7
- const openUrl = ({ url, closeGameReader }) => {
7
+ const openUrl = ({ url, closeGameReader, closeGameReaderPayload }) => {
8
8
  if (env_1.isAndroid) {
9
9
  if (window.Android.openUrl !== undefined) {
10
10
  window.Android.openUrl(JSON.stringify({ url }));
@@ -21,7 +21,7 @@ const openUrl = ({ url, closeGameReader }) => {
21
21
  }
22
22
  }
23
23
  if (closeGameReader) {
24
- (0, index_1.closeGameReader)();
24
+ (0, index_1.closeGameReader)(closeGameReaderPayload);
25
25
  }
26
26
  };
27
27
  exports.openUrl = openUrl;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@inappstory/game-center-api",
3
- "version": "1.3.10",
3
+ "version": "1.3.12",
4
4
  "description": "",
5
5
  "dependencies": {
6
6
  "semver": "^7.3.8",